Driver Binaries
To run automation based on the WebDriver protocol you need to have browser drivers set up that translate the automation commands and are able execute them in the browser. The following describes how you can set up each driver individually. You can find a list with all drivers in the awesome-selenium
README.
If you are looking to set up mobile and other UI platforms, have a look into our Appium Setup guide.
Chromedriver
To automate Chrome you can download Chromedriver directly on the project website or through the NPM package:
- npm
- Yarn
npm install -g chromedriver
yarn add -g chromedriver
You can then start it via:
chromedriver --port=4444 --verbose
Geckodriver
To automate Firefox download the latest version of geckodriver
for your environment and unpack it in your project directory:
- Curl
- Brew
- Windows (64 bit / Chocolatey)
- Windows (64 bit / Powershell) DevTools
Linux:
curl -L https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz | tar xz
MacOS (64 bit):
curl -L https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-macos.tar.gz | tar xz
brew install geckodriver
choco install selenium-gecko-driver
# Run as privileged session. Right-click and set 'Run as Administrator'
# Use geckodriver-v0.24.0-win32.zip for 32 bit Windows
$url = "https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-win64.zip"
$output = "geckodriver.zip" # will drop into current directory unless defined otherwise
$unzipped_file = "geckodriver" # will unzip to this folder name
# By default, Powershell uses TLS 1.0 the site security requires TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Downloads Geckodriver
Invoke-WebRequest -Uri $url -OutFile $output
# Unzip Geckodriver
Expand-Archive $output -DestinationPath $unzipped_file
cd $unzipped_file
# Globally Set Geckodriver to PATH
[System.Environment]::SetEnvironmentVariable("PATH", "$Env:Path;$pwd\geckodriver.exe", [System.EnvironmentVariableTarget]::Machine)
Note: Other geckodriver
releases are available here. After download you can start the driver via:
/path/to/binary/geckodriver --port 4444
Edgedriver
You can download the driver for Microsoft Edge on the project website. After download you can start Edgedriver as follows:
./path/to/edgedriver --port=4444 --verbose
Safaridriver
Safaridriver comes pre-installed on your MacOS and can be started directly via:
safaridriver -p 4444