public boolean WaitForPageToLoad(){
final ExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>() {
public Boolean apply(final WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript("return document.readyState").equals("complete");
}
};
final WebDriverWait wait = new WebDriverWait(this.driver, this.defaultTimeoutinSeconds);
final boolean IsPageLoad = wait.until(pageLoadCondition);
if (!IsPageLoad) {
log.logInfo("Page doesn't load after " + this.defaultTimeoutinSeconds + " seconds");
}
return IsPageLoad;
}
above code was working in selenium 2.53.1 but when I upgraded to Selenium 3.1.X, above code is not compatible. Plaese anyone convert above code to make it compatible with selenium 3. I am getting below error
The method until(Function) in the type FluentWait is not applicable for the arguments (new ExpectedCondition(){})