Creating Custom Waits for Finding Elements

The following code sets a custom wait of five seconds while attempting to find an element with ID "info". Once it finds the element, the automation script will return that same element:

WebElement element = new WebDriverWait(driver, 5)
.until(new ExpectedCondition<WebElement>() {
public WebElement apply(WebDriver d) {
return d.findElement(By.id("lesson"));
}
});
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.42.208