Web Driver Wait
1) WebDriverWait wait = new
WebDriverWait(driver, waitTime);
wait.until(ExpectedConditions.presenceOfElementLocated(locator));
The above statement will
check for the element presence on the DOM of a page.
This does not necessarily
mean that the element is visible.
2)WebDriverWait wait = new WebDriverWait(driver, waitTime);
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
The above syntax will for the element present
in the DOM of a page is visible.
3) WebDriverWait
wait = new WebDriverWait(driver, waitTime); wait.until(ExpectedConditions.invisibilityOfElementLocated(locator));
Some times we may also need to check if the
element is invisible or not. To do this we need use the above
4) WebDriverWait wait = new
WebDriverWait(driver, waitTime); wait.until(ExpectedConditions.elementToBeClickable(locator));
Comments
Post a Comment