In this section:
Introduction
Selenium WebDriver is a framework that facilitates web application automation. It makes direct calls to the browsers installed on the machine using the browsers' native driver. Each major browser provides its own implementation of the WebDriver interface (usually referred to as a "WebDriver," too). The appropriate WebDriver is required for each browser your Selenium tests are written to execute. Refer to the System Requirements for a list of supported browsers and drivers.
Downloading WebDrivers
Be sure to download the correct WebDriver for your browser version.
- Chrome: http://chromedriver.chromium.org/downloads.
- Microsoft Edge: The Microsoft WebDriver for Edge version 18 and 19 ships with Windows and can be installed by running the following command:
DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
For builds prior to 18, you can download the appropriate driver for your version of Edge from the Microsoft developer site:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ - Firefox: https://github.com/mozilla/geckodriver/releases.
- Internet Explorer: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
If you are setting up the WebDriver for IE11, use the 32-bit version of the driver, regardless of the system and browser architectures. - Safari: The WebDriver for Safari is built into macOS.
Extract the executables from the downloaded files to your machine.
Configuring WebDriver Preferences
Configuring the WebDriver preferences enables you to execute run configurations in your IDE.
- Choose Parasoft> Preferences from the Eclipse menu.
- Choose Selenium WebDriver from the Parasoft sidebar menu.
Specify the path to the appropriate WebDriver for the browser version in each field. Only the WebDrivers for the browsers you intend to test with need to be provided. Each operating system supports different browsers. The following screenshots show the WebDriver configuration screen for Windows and macOS to illustrate.
Configuring WebDrivers on Windows 10Configuring WebDrivers on MacOSMicrosoft Edge and Apple Safari are native OS browsers. The OSes already include Microsoft WebDriver (for the latest versions of Windows and Edge) and SafariDriver, respectively.
- Click Apply to save your configuration.
Specifying WebDrivers on the Command Line
If you are using the command line to run Selenic, you need to include an argument to call the WebDriver in each command for every browser you are testing, e.g.:
mvn test -DargLine=-javaagent:/path/to/selenic_agent.jar -Dwebdriver.chrome.driver=/path/to/chromedriver
See Usage for details.
Adding WebDrivers to Your Path
You can add the location of the WebDriver to the PATH system variable so that you do not need to include the path to the WebDriver in each command.
Using a Package Manager
The easiest way to add the WebDriver to your PATH is to use a package manager, such as Chocolaty for Windows or brew for MacOS, e.g.:
choco install chromedriver
brew cask install chromedriver
The package manager will copy the WebDriver executable to a directory on the PATH.
Manually Adding WebDrivers to the PATH
If you do not have a package manager installed, you can manually add the WebDrivers to the PATH.
Windows
The following instructions describe how to add the executable to the PATH using Windows 10. Refer to the documentation for your version if you are on a different version of Windows.
- Click the Windows start menu and choose Windows System> Control Panel.
- Click System and Security.
- Click System.
- Click Advanced system settings.
- Click Environment Variables and double click the Path entry in the System variables panel.
- Choose the C: drive variable and click Edit.
- Add a semicolon (
;
) and specify the directory containing the WebDriver executable. - Click OK to save the edit and click OK to close the Environment Variables panel.
- Click OK to close the System Properties panel.
- Restart Windows.
MacOS
Open Terminal and open /etc/paths in an editor as an administrator, e.g.:
sudo vim /etc/paths
- Enter you password when prompted.
- Add the path to the directory containing your WebDrivers to the file.
- Save and close the file.