因此,对于 Selenium 3.4,我以前工作wait.until
的 s 无法正常工作(已被新方法取代)。我似乎无法让新方法发挥作用。
我在用着
import com.google.common.base.Function;
旧代码:
public boolean waitForURLToMatch(String expectedURL, int waitTime){
WebDriverWait wait = new WebDriverWait(driver, waitTime);
wait.until(EcpectedConditions.urlMatches(expectedURL));
}
新代码:
public boolean waitForURLToMatch(String expectedURL, int waitTime){
WebDriverWait wait = new WebDriverWait(driver, waitTime);
wait.until(new Function<WebDriver, boolean>){
@Override
public boolean apply(WebDriver driver) {
return driver.getCurrentUrl().equals(expectedURL);
}
}
}
新代码在eclipse中有错误:
Syntax error on tokens, InterfaceHeader expected instead
关于我哪里出错的任何想法?