2
votes

I get the following error while launching chrome driver. Any suggestions?

package packag;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Demo2
{
    public static void main (String [] args)
    {
        System.setProperty("webdriver.chrome.driver","C:/chromedriver.exe");
        WebDriver driver= new ChromeDriver();
        driver.get("http://www.google.com");
        driver.close();
    }
}

Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 26665 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.2 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 754 milliseconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' System info: host: 'Vishak', ip: '192.168.0.23', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_25' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116) at packag.Demo2.main(Demo2.java:11)

4
It can't find Google Chrome, not the chrome driver. Make sure you have google chrome installed in the location the driver is expecting.Parker Beck
Did you find an answer to this question? - Having the same issue.fuzzi

4 Answers

2
votes

Install Chrome on the machine running your code.

1
votes

It is due to ChromeDriver and Chrome Browser incompatibility. Either you need to update ChromeDriver or vice verse. I would recommend installing updated versions of both on safer side.

0
votes

Make sure you have latest chromedriver.exe and placed it under C:/chromedriver.exe directory.

If not please download the same from here and place it in specified directory.

0
votes

I was able to reproduce the issue by placing the wrong executable. so you can

  • download the correct executable for your platform.
  • you may want to place the driver executable somewhere other than the "c" drive. may be documents directory for your user, or create a directory in your project and refer from there.