![Chrome driver windows 64 bit Chrome driver windows 64 bit](/uploads/1/2/4/4/124427277/620213383.png)
The ChromeDriver getting started guide isn’t super helpful if you are unfamiliar with including the ChromeDriver location in your PATH environment variable. The PATH variable helps Chrome find the downloaded ChromeDriver exe. Don’t get me wrong, I’ve updated PATH variables on Windows for years but never on a Mac, until now:
Listed in order of easiest to hardest install, these are the best ways to install ChromeDriver on a Mac: The easiest way to install ChromeDriver is to use your package manager such as brew or npm to install the driver. In your terminal window with the Homebrew package manager: Install ChromeDriver with brew cask install chromedriver; Confirm it. I needed to run Selenium on macOS for the first time today. Here's how I got it working. ## Install the chromedriver binary ### If you have homebrew This is by far the easiest option: brew cask install chromedriver This also ensures `chromedriver` is on your path, which means you don't need to use an explicit `chromedriverpath` later on. You still need to run it once in the terminal.
System PATH Setup
The following instructions will help you create your own PATH to a unique folder on your Mac or copy the file to an existing PATH directory for ChromeDriver.
- Download the ChromeDriver executable.
- Now we need to tell Selenium where it is and for that we have a few choices.To do this:
- Open up Terminal
- Run
sudo nano /etc/paths
- Enter your password
- Go to the bottom of the file and enter the path you wish to add
- My PATH looks like:
/Users/myname/Documents/WebDriver
- Control-x to quit
- Y to save
- Press enter to confirm
- To double check, quit Terminal and relaunch it. Run
echo $PATH
. You should see your newly added path in the stream of other paths already there. - Finally, update your tests to run using Chrome and run your tests!
After running your tests, if your PATH isn’t set up correctly you get this helpful message:
Did this work for you? Did it solve your problem? Please leave a comment below.
Additional Resources:
Oh and if this article worked for you please consider sharing it:
Or buying me coffee.
![Download Download](/uploads/1/2/4/4/124427277/310237924.jpg)
The ChromeDriver getting started guide isn’t super helpful if you are unfamiliar with including the ChromeDriver location in your PATH environment variable. (The PATH variable helps Chrome find the downloaded ChromeDriver exe). Also it’s a lot of work for something so common. Never fear, here is a better way:
Installing on macOS:
Listed in order of easiest to hardest install, these are the best ways to install ChromeDriver on a Mac:
- The easiest way to install ChromeDriver is to use your package manager such as brew or npm to install the driver.
- In your terminal window with the Homebrew package manager:
- Install ChromeDriver with
brew cask install chromedriver
- Confirm it was installed using
chromedriver --version
and seeing it returns a version. If it errors it wasn’t installed
- Install ChromeDriver with
- Other package managers like npm have similar commands
npm install chromedriver
- In your terminal window with the Homebrew package manager:
- Run Chrome & ChromeDriver in a container using Docker. Simply download the combined container, start it and point your code at the right address.
- Specify it in your Selenium setup code and check it into source control like any other configuration detail. If you go this route, you can include additional drivers like GeckoDriver (aka Firefox) as well.
- Download the driver and add its location to your System PATH.
Which methods have you found the easiest or most success with? Which methods didn’t work for you? Please leave a comment below.
Additional Resources
Chromedriver Mac Os
Oh and if this article worked for you please consider sharing it or buying me coffee to say thanks.