Skip to content

java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V #3880

@drno-reg

Description

@drno-reg

Hello,

I have browser Google Chrome 57.0.2987.133 (64-bit), webdriver chrome
ChromeDriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233), Java
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode).

Tried to run Code on Java

        System.setProperty("webdriver.chrome.driver", "C:\\Server\\templates\\selenium\\chromedriver.exe");
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        ChromeOptions options = new ChromeOptions();
//this statement will not show any warnings when you launch chrome
        options.addArguments("test-type");
//start a maximized window
        options.addArguments("start-maximized");
//this allows you to use a user profile
        capabilities.setCapability("chrome.binary", "C:\\Server\\templates\\selenium\\chromedriver.exe");
        capabilities.setCapability(ChromeOptions.CAPABILITY, options);
        WebDriver driver = new ChromeDriver(capabilities);

and returned 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
	at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:111)
	at 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.<init>(ChromeDriver.java:146)

How to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions