WebDriver出错

时间:2017-12-20 01:52:33

标签: java selenium selenium-webdriver

我有以下错误:

     id   amount
0  1001  1710.34
1  1003    18.95
2  1004   321.20

我的代码:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
    at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:136)
    at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:41)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.usingFirefoxBinary(GeckoDriverService.java:134)
    at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:155)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98)
    at automationFramework.SecondTest.main(SecondTest.java:20)

1 个答案:

答案 0 :(得分:0)

这看起来像是Guava库的一个问题。如果您使用maven来管理依赖项,请手动设置Guava版本:

<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>22.0</version>
</dependency>

此外,从系统属性中删除\\部分。它应该只是\\