Tuesday, December 20, 2016

WebDriver - geckodriver.exe File Does Not Exist

WebDriver - geckodriver.exe File Does Not Exist

While running tests using WebDriver & C# in Visual Studio with Firefox, if you happen to receive below exception:

OpenQA.Selenium.DriverServiceNotFoundException: The geckodriver.exe file does not exist in the current directory or in a directory on the PATH environment variable.

then just go to this link and download the geckodriver.exe file.

One of the solution is to put the file (geckodriver.exe) in the bin\Debug folder of the current project which you are trying to run. You can right-click on the project name, choose 'Open Folder in File Explorer',

go to bin\Debug and paste the geckodriver.exe file in there.

Now the test should run fine.