OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory

Problem

I’m trying to use Selenium with the ChromeDriver and I’m running into the following exception:

Unhandled Exception: OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html

Solution

The simplest solution is to install the Selenium.Chrome.WebDriver nuget package. This results in the ChromeDriver.exe being put into your build directory.

  1. Right-click your project > click Manage NuGet Packages
  2. Install the Selenium.Chrome.WebDriver nuget package

Note: You can always specify the chromedriver.exe in the constructor, but this requires you to have it installed already. Installing via nuget is a simpler approach.

Leave a Comment