使用Java做selenium
自动化测试时,引入pom.xml
文件
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
Java代码调用WebDriver
驱动时
Wait(driver).until(windowToBeAvailableAndSwitchToIt(target))
可能会报如下的错误
The method until(Function<? super WebDriver,V>) in the type FluentWait<WebDriver> is not applicable for the arguments
解决方案
把Guava 的版本升级到21,就完美解决。
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
参考链接:https://softwaretestingboard.com/q2a/1907/function-webdriver-fluentwait-webdriver-applicable-arguments#axzz60cfO4vgE