Using Selenium on Mac 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
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.