jeudi 6 mars 2014

Difference between element.isDisplayed() and wait.until(ExpectedConditions.visibilityOf(element));


Vote count:

0




I am trying to use WebDriver's fluentAPI, and am slightly confused with the choices available. I want to wait for an element to become visible. I undertsand that there are many ways available to do thisbut I want to sepcifically understand the difference between the below two methods :



(1)new FluentWait<WebElement>(webElement).
withTimeout(timeoutSeconds, TimeUnit.SECONDS).
pollingEvery(pollingTime, TimeUnit.MILLISECONDS).
untilwait.until(ExpectedConditions.visibilityOf(element));

(2) public void waitForWebElementFluently(WebElement webElement) {
new FluentWait<WebElement>(webElement).
withTimeout(timeoutSeconds, TimeUnit.SECONDS).
pollingEvery(pollingTime, TimeUnit.MILLISECONDS).
until(new Predicate<WebElement>() {
@Override
public boolean apply(WebElement element) {
return element.isDisplayed();
}
}
);
}


What is the difference between using isDisplayed, and visibilityOf?



asked 18 secs ago






Aucun commentaire:

Enregistrer un commentaire