0

I am trying to use the ChromeDriver in Selenium, but Chrome "fails to start." Is there something that might I might be doing wrong? Thank you!
My code:

    public static void main(String[] args) {
         System.setProperty("webdriver.chrome.driver", "C:\\Users\\Bill\\Desktop\\StockBot Workspace\\Files\\chromedriver.exe");
         WebDriver driver = new ChromeDriver();
         driver.get("http://www.google.com");
     }

What is outputted in console:

Starting ChromeDriver 2.12.301325 (962dea43ddd90e7e4224a03fa3c36a421281abb7) on port 50099
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: chrome failed to start
  (Driver info: chromedriver=2.12.301325 (962dea43ddd90e7e4224a03fa3c36a421281abb7),platform=Windows NT 10.0 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 707 milliseconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
System info: host: 'Zeus', ip: '192.168.7.103', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_60'
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:647)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
    at Runner.main(Runner.java:7)
Bill Ray
  • 88
  • 1
  • 13
  • You have a whitespace in your path. As far as I can remember this will not work. When you place your chromedriver.exe in another location it should work. – Frank Mar 21 '16 at 14:42
  • No luck, same error. Thanks though – Bill Ray Mar 21 '16 at 14:45

2 Answers2

1
  1. Uninstall chrome

  2. Remove the chrome folder from the directory C:\Users____\AppData\Local\Google\chrome

  3. Reinstall chrome

I had the same error and this worked for me.

answered Aug 29 '14 at 8:11 on stackoverflow by Paweł Adamski ChromeWebDriver - unknown error: Chrome failed to start: crashed

  • If you are going to link an answer from a different post, it is better to mark it as a duplicate or comment the fact that it has already been answered somewhere. You are new user so you cant do some of those things so props to you for at least saying where you got the answer from and not claiming it as your own! – Mixone May 26 '18 at 11:21
0

Try uninstalling the chrome browser on your machine. Then delete the chrome user profile.

Re-install chrome and check if it works. Had this problem before, worked for me.

Anand
  • 1,899
  • 1
  • 13
  • 23