Remote Webdriver Chrome throws a “path to the driver executable” error

∥☆過路亽.° 提交于 2019-12-01 19:21:36

The clue really is in the error.

Chrome should be installed on the system where the tests are either running on or being pointed to.

Take a step back, look at the documentation:

https://code.google.com/p/selenium/wiki/ChromeDriver

Also, if Chrome is installed in a peculiar place, you'll need to point Selenium to it's location. Again, this is explained in the documentation.

In C#:

DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
capabilities.SetCapability("chrome.binary", this.binaryLocation);

or:

ChromeOptions options = new ChromeOptions();
options.BinaryLocation = "pathtogooglechrome";
capabilities.SetCapability(ChromeOptions.Capability, options);

Instead of changing the code you can have other way round.
Download the chrome driver and set the PATH environment variable pointing to the directory where the chromedriver.exe is present.

Restart your IDE / Command console and run the tests. It works!!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!