Frage

I created a program that requires ChromeDriver.

It works fine on Mac OS X and Linux, but when I try to start it on Windows it hangs on the following:

"driver = new ChromeDriver(capabilities);"

However no error is generated.

I have loaded the chrome driver correctly and I set the binary path to chrome.exe correctly. for some unknown reason it just hangs when initializing the driver.

    ChromeOptions options = new ChromeOptions();
    options.addArguments("window-size=800,600");
    options.setBinary(getChromePath()); //Returns Chrome Path (Works)

    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability(ChromeOptions.CAPABILITY, options);

    driver = new ChromeDriver(capabilities);
    driver.manage().timeouts().pageLoadTimeout(pageLoadTimeout, TimeUnit.SECONDS);

I have no idea why this is happening and chromedriver.exe is never even started up as a process. This doesn't work with any Windows computers, but works with every other operating system.

War es hilfreich?

Lösung

If you don't use capabilities, would it start normally?

The following answer might not be related to your problem. Debug yours first, then try it if you don't have other solutions.

Chrome have been updating frequently recently and you need to find a ChromeDriver version compatible with it.

The latest Chrome release is 2.8, according to release note, it should support Chrome 30-33.

However, from this question, I believe the recent Chrome updates broke it again. Chrome 32.0.1700.72 m should work fine with ChromeDriver 2.8, but 32.0.1700.76 and 32.0.1700.77 won't.

So try two solutions at the time of writing.

  1. Downgrade your Chrome to 32.0.1700.72 m or even lower.
  2. Since ChromeDriver 2.8 is already the latest, all you can do is to wait for a new version to come out, which should be on its way.

Andere Tipps

Selenium requires English windows operating system. Otherwise it doesnt trigger any browser. When I changed my windows 10 turkish version to english it started working without any problem. If you are having the same issue with both IE, gecko driver and chrome driver than the issue is definiately this one.

you are using the latest version of chrome 32.0.1700.76 m......means you have to update the chrome driver server also that is 2.8...and selenium 2.39

check this line: DesiredCapabilities capabilities = DesiredCapabilities.firefox();

you are working with chrome and there is still firefox to which capabilities refer to.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top