简体   繁体   English

不存在类型变量 V 的实例,因此 ExpectedCondition<Boolean> 符合功能<? super WebDriver, V>

[英]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.

相关问题 不存在类型变量 V 的实例,因此 ExpectedCondition<boolean> 符合 Function<!--? super WebDriver, V--> 使用 Selenium 3.13.0 时出错</boolean> - No instance(s) of type variable(s) V exist so that ExpectedCondition<Boolean> conforms to Function<? super WebDriver, V> error using Selenium 3.13.0 方法直到(函数<!--? super WebDriver,V--> ) 在 FluentWait 类型中不适用于 arguments (boolean, ExpectedCondition<webelement> )</webelement> - The method until(Function<? super WebDriver,V>) in the type FluentWait is not applicable for the arguments (boolean, ExpectedCondition<WebElement>) Java错误:不兼容的类型:不存在类型变量R的实例,因此Stream <R> 符合布尔值 - Java Error: incompatible types: no instance(s) of type variable(s) R exist so that Stream<R> conforms to boolean 不存在类型变量T的实例,因此ID符合Comparable <? super T> - No instance of type variable(s) T exist so that ID conforms to Comparable<? super T> 不存在类型变量的实例,因此T符合注释 - No instance(s) of type variable(s) exist so that T conforms to Annotation Comparator - thenComparing() 方法产生'不存在 U 类型变量的实例,因此 Object 符合 Comparable<!--? super U--> ' - Comparator - thenComparing() method produces 'no instance(s) of type variable(s) U exist so that Object conforms to Comparable<? super U>' Decimal128 的排序问题 | 不存在类型变量 U 的实例,因此 Decimal128 符合 Comparable<!--? super U--> - Sorting issue for Decimal128 | no instance(s) of type variable(s) U exist so that Decimal128 conforms to Comparable<? super U> 不存在类型变量V,K的实例,因此HashMultiMap <V,K> 符合MultiMap &lt;..,..&gt; - No instance of type variable V,K exist so that HashMultiMap<V,K> conforms to MultiMap<..,..> 不兼容的类型:不存在类型变量 T 的实例,因此 Matcher<t> 符合 ArgumentMatcher<long></long></t> - incompatible types: no instance(s) of type variable(s) T exist so that Matcher<T> conforms to ArgumentMatcher<Long> 不存在类型变量U的实例,因此Optional <U>符合Response</u> - No instance(s) of type variable(s) U exist so that Optional<U> conforms to Response
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM