Selenium: Unable to launch chrome browser using selenium 3.1.0

Created on 20 Feb 2017  Â·  11Comments  Â·  Source: SeleniumHQ/selenium

Meta -

OS:
Windows 7
Selenium Version:
3.1.0
Browser:
Chrome

I used below code for 3.0.1, it was working:

System.setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
driver = new ChromeDriver(capabilities);
System.out.println(driver);

The code is not working on selenium version 3.1.0

Error:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V

Have any work around in this version?

C-java

All 11 comments

Hey,

I think you downloaded Selenium 3.1.0 from NuGet Website. Still http://www.seleniumhq.org/ not yet announced about this release.

Fix for your issue :- Check your local machine Chrome browser is updated to the latest version. If not then upgrade to latest version.

@Vrushabhh Now it fixed, I didn't add guava dependency in my pom.xml and working now as expected.

Hi,

I have windows 7 and Chrome Version is: 57.0.2987.110 (64-bit). I updated pom.xml with the latest version of Selenium

org.seleniumhq.selenium
selenium-java
3.3.1
I was unable to run the tests. I also got the error described by Sanojqa and more:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Vat org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:146)

Thank you for your help

I have tried the latest version of the guava (22.0) but it's not working for me. I have got the same error again.

Following are my dependencies in pom.xml and it working for me:

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>21.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.2.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.2.0</version>
    </dependency>

if you are using GLASSFIASH as an application sever its about guava conflict with default application server!
set parameter delegate in glassfish-web.xml to false

@saeidlogo 's answer solved my problem.

if you are using GLASSFIASH as an application sever its about guava conflict with default application server!
set parameter delegate in glassfish-web.xml to false

I'm building a Java EE application in Netbeans that runs Glassfish. I was trying to run Selenium with ChromeDriver, but continually received the error of "java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V"

By going into my glassfish-web.xml Configuration File, and changing <class-loader delegate="true"/> to <class-loader delegate="false"/>, my problem was fixed.

Hi,

I have windows 7 and Chrome Version is: 75.0.3770.142 (64-bit).version of Selenium
org.seleniumhq.selenium
selenium-java
3.1.4
I was unable to run the tests.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Vat org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at

The latest version should be "3.141.59".
MM

Sent from my iPhone

On Jul 25, 2019, at 8:11 AM, mv4263368 notifications@github.com wrote:

Hi,

I have windows 7 and Chrome Version is: 75.0.3770.142 (64-bit).version of Selenium
org.seleniumhq.selenium
selenium-java
3.1.4
I was unable to run the tests.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Vat org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings