I want to wait until a js script return true, the code I am using is not compiling and throwing error
is not abstract and does not override abstract method apply(Object) in Function
here is the code
WebDriverWait wait = new WebDriverWait(driver, 10);
boolean isFound = wait.until(new ExpectedCondition(){ //here ERROR
public Boolean apply(WebDriver d){
JavascriptExecutor js = (JavascriptExecutor) d;
return (Boolean) js.executeScript("return true");
}
});
I tried to copy code from
http://www.tarnowski.se/2011/09/11/converting-selenium-waitforcondition-to-webdriverwait/
instead of
try
The Function class/interface expects a method with this signature in its subclasses that you create.
If there’s a
raw typeswarning, perhapsnew ExpectedCondition<WebDriver>(){ ...is what you’re expected to do?