Nashibukasan
Nashibukasan

Reputation: 2028

Visual Studio 2010 will not looking for 'chromedriver.exe' in Chrome default path

I understand that there are a few ways to create a new Chrome driver instance, and the way that has worked best for me is passing in its location as a parameter (new ChromeDriver("path", capabilities)). However, I am now wanting to move to testing on a VM and I want to run the driver from the default location (C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe as seen on the documentation). I am running Windows 7 and when I run my test (debug and non-debug modes) through VS2010 the error message suggests it is looking in the 'TestResults\Out' folder and thus cannot find the driver. Is this a VS2010 issue or have I done something wrong?

Also apologise if this has been answered before, all the other posts I found thus far have not helped :(

EDIT: Or is it necessary to specifically state the Chrome install path on Win7? I guess I could do this, but would prefer things to be a default area just in case a future VM default install path is different.

Upvotes: 0

Views: 1505

Answers (1)

Pavel Janicek
Pavel Janicek

Reputation: 14748

Its not about where the Chrome is. Its about where chromedriver.exe is.

You have to set up the webdriver.chrome.driver into your system variables. In Windows (XP):

Control Panel -> System -> Tab Advanced -> Environment Variables -> New

Variable name: webdriver.chrome.driver

Variable value: C:\path\to\chromedriver\chromedriver.exe

See screen here: http://twio.cz/ae0n

ChromeDriver can be downloaded here

Upvotes: 1

Related Questions