Using Selenium on Mac Chrome Using Selenium on Mac Chrome google-chrome google-chrome

Using Selenium on Mac Chrome


If you want to use Selenium WebDriver with Chrome, first download ChromeDriver - WebDriver for Chrome. This can be installed via Homebrew with brew install chromedriver, or manually by downloading, extracting, moving and setting the PATH as follows:

$ cd $HOME/Downloads$ wget http://chromedriver.storage.googleapis.com/2.22/chromedriver_mac32.zip$ unzip chromedriver_mac32.zip$ mkdir -p $HOME/bin$ mv chromedriver $HOME/bin$ echo "export PATH=$PATH:$HOME/bin" >> $HOME/.bash_profile

Source: install and set path to chromedriver on mac or linux

You should then read Getting started with ChromeDriver on Desktop, in particular the sample code which shows how you map the path to the executable and instantiate ChromeDriver. If you have a reference to the driver in the PATH variable, you can omit the configuration line.

You can install both packed (.crx file) and unpacked (directory) extensions via ChromeDriver. See the code snippets for setting either up here.

If you were using Selenium IDE for FireFox instead, there is no version available for Chrome. The best alternative I know of is iMacros for Chrome.


Sometimes you will face a problem with the old version of chromedriver and when you try to install it using this command:

brew cask install chromedriver

It shows you the following:

Error: It seems there is already a Binary at '/usr/local/bin/chromedriver'; not linking.

However, you can the following step:

brew cask reinstall chromedriver

If it still shows you the same error, you can remove it with the following command

rm /usr/local/bin/chromedriver

and install it again

brew cask install chromedriver

You should have the last updated version of chrome driver


I think that the easy way for running mac osx, chrome and selenium together is like this on mac os terminal:

# download selenium jarcurl -L0 https://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.1.jar -o selenium-server-standalone.jar# install chromedriver using caskbrew cask install chromedriver# start chrome driverbrew services start chromedriver                                                                                                                                                                      #==> Successfully started `chromedriver` (label:homebrew.mxcl.chromedriver)# start selenium serverjava -jar selenium-server-standalone.jar                                                                                                                                                                           #14:38:20.684 INFO - Selenium build info: version: '3.9.1', revision: '63f7b50'#14:38:20.685 INFO - Launching a standalone Selenium Server on port 4444