public boolean CheckPageLoadStatus(){
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 IsPageLoaded = wait.until(pageLoadCondition);
if (!IsPageLoaded) {
log.logInfo("The page did not finish loading after " + this.defaultTimeoutinSeconds + " seconds");
}
return IsPageLoaded;
}
The code above was functioning properly in Selenium 2.53.1. However, after upgrading to Selenium 3.1.X, it is no longer compatible. Could someone please modify the code to be compatible with Selenium 3? I am encountering the following error message:
The method until(Function) in the type FluentWait is not applicable for the arguments (new ExpectedCondition(){})