0
votes

I am trying to run a Java webapp hosted on tomcat that will run selenium / chrome web driver.

However when you try to launch the chromedriver you get a 500 internal server error

java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)

I've tried multiple variants to load the drivers as well as changing to firefoxdriver and RemoteWebDriver but i still get the same issue.

I have placed the chromeDriver and Chrome.exe within web pages/web-inf/lib. Also System.setProperty("webdriver.chrome.driver","chromedriver.exe");

But nothing changes.

Is this even possible?

1
I'm pretty sure you need to specify the full page to the chromedriver including the .exe extension.JeffC

1 Answers

0
votes

It was a terrible challenge for me the find a fully working combination of these two artifacts

  • selenium-chrome-driver
  • Google guava (which includes com.google.common.base.*)

I finally manage to get a working one:

  • selenium 3.12.0
  • guava 21.0

webdrivers.xml

 <root>
        <windows>
             <driver id="googlechrome">
                <version id="2.35">
                    <bitrate thirtytwobit="true" sixtyfourbit="true">
                        <filelocation>https://chromedriver.storage.googleapis.com/2.35/chromedriver_win32.zip</filelocation>
                        <hash>c787c0b36fbf8ea3325df386c0c3c41d3f681b4b</hash>
                        <hashtype>sha1</hashtype>
                    </bitrate>
                </version>
            </driver>
        </windows>
        <linux>
            <driver id="googlechrome">
                <version id="2.35">
                    <bitrate sixtyfourbit="true">
                        <filelocation>https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip</filelocation>
                        <hash>ccc980e3b0b74f0d067f1d3e89d9cc81b8a6b2aa</hash>
                        <hashtype>sha1</hashtype>
                    </bitrate>
                </version>
            </driver>
        </linux>
        <osx>
            <driver id="googlechrome">              
                <version id="2.36">
                    <bitrate sixtyfourbit="true">
                        <filelocation>https://chromedriver.storage.googleapis.com/2.36/chromedriver_mac64.zip</filelocation>
                        <hash>28b58747bbb4b4591ff939a692f8755a11428550</hash>
                        <hashtype>sha1</hashtype>
                    </bitrate>
                </version>            
            </driver>        
        </osx>
    </root>