[英]No instance(s) of type variable(s) V exist so that ExpectedCondition<Boolean> conforms to Function<? super WebDriver, V>
This compile-time error is thrown:抛出此编译时错误:
No instance(s) of type variable(s) V exist so that ExpectedCondition<Boolean>
conforms to Function<? super WebDriver, V>
For this code:对于此代码:
ExpectedCondition<Boolean> expectation = new
ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript("return window.value").(true);
}
};
new WebDriverWait(driver, timeout)
.until(expectation);
Whereas, the ExpectedCondition
conform to conforms to Function<? super WebDriver, V>
而
ExpectedCondition
符合conforms to Function<? super WebDriver, V>
conforms to Function<? super WebDriver, V>
I'm baffled by the error, any ideas what could be wrong here?我对错误感到困惑,有什么想法这里可能有什么问题吗?
The issue was there is a Guava version 18.0 in the dependency, then changing it back to version 22.0 solved the problem:问题是依赖项中有一个 Guava 18.0 版,然后将其改回 22.0 版解决了问题:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
也许您可以将依赖项(selenium-java)先放在依赖项中,然后再重新加载 maven
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.