Download Chromedriver Binary and Add to Your PATH for Automated Functional Testing

Published: Sep 19, 2018 • Updated: Nov 15, 2021

Many automated functional testing projects these days rely on chromedriver as the main driver. Below are steps for Mac and Windows to download it, add it to your PATH, and verify setup.

You can obviously place the chromedriver binary in any directory you like, I just used Mac ${HOME}/bin and Windows C:\bin for this example.

This article is basically a more specific version of How to Add a Binary (or Executable, or Program) to Your PATH on macOS, Linux, or Windows.

Mac CLI #

  1. Get familiar with Mac Environment Variables in Terminal
  2. Create directory ${HOME}/bin
  3. Download chromedriver for Mac and save to ${HOME}/bin
  4. Make it executable with cd ${HOME}/bin && chmod 755 chromedriver
  5. Open ${HOME}/.bash_profile in a text editor
  6. Add line export PATH="${PATH}:${HOME}/bin" then save the file
  7. Restart your Terminal
  8. Verify setup with chromedriver -v

Windows CLI #

  1. Get familiar with Windows Environment Variables in Command Prompt

  2. Create directory C:\bin

  3. Download chromedriver for Windows and save to C:\bin

  4. Open Command Prompt and set the PATH for your account

     setx PATH "%PATH%;C:\bin"
  5. Restart Command Prompt

  6. Verify setup with chromedriver.exe -v

Windows GUI #

  1. Create directory C:\bin
  2. Download chromedriver for Windows and save to C:\bin
  3. Depending on your Windows version
    • If you’re using Windows 8 or 10, press the Windows key, then search for and select System (Control Panel)
    • If you’re using Windows 7, right click the Computer icon on the desktop and click Properties
  4. Click Advanced system settings
  5. Click Environment Variables
  6. Under System Variables, find the PATH variable, select it, and click Edit. If there is no PATH variable, click New
  7. Add C:\bin to the end of the variable value, preceeded by a ;. For example, if the value was C:\Windows\System32, change it to C:\Windows\System32;C:\bin
  8. Click OK
  9. Restart Command Prompt
  10. Verify setup with chromedriver.exe -v