java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V with IE and Selenium through Java

后端 未结 1 1843
一向
一向 2020-11-30 16:05

I am trying to use selenium with sikuli.So sikuli would not run on a 64 bit using the current java set up so in my project changed the runtime to point to a 32 bit runtime e

相关标签:
1条回答
  • 2020-11-30 16:12

    This error message...

    java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
    

    ...implies that the IEDriverServer was unable to initiate/spawn a new WebBrowsing Session i.e. InternetExplorer Browser session.

    Your main issue is the incompatibility between the version of the binaries you are using as follows:

    • You have mentioned about using guava-21.0-jre.jar which is pretty ancient.

    Solution

    Solution to your question would be either/all of the following steps:

    • Upgrade Selenium to current levels Version 3.14.0 which includes guava-25.0-jre.
    • Upgrade Guava to current levels of 26.0-jre (as per Selenium v3.14.0 Java clients).

      • Maven Dependency is as follows:

        <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>26.0-jre</version>
        </dependency>
        
    • Ensure you don't have several versions in your dependency tree.

      • To look for the existing guava versions through Maven use the command:

        mvn dependency:tree | less
        
    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.

    • If issue still persists delete the MAVEN_HOME directory .m2 and download the binaries afresh.
    0 讨论(0)
提交回复
热议问题