In this section:
|Table of Contents|
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 (also referred to as a "WebDriver"). A compatible WebDriver is required for each browser in which your Selenium tests are written to execute. Refer to System Requirements for a list of supported browsers and drivers.
Download the correct WebDriver for your browser version.
- Chrome: http://chromedriver.chromium.org/downloads.
Microsoft Edge: Visit the Microsoft developer website for instructions on downloading and installing Microsoft WebDriver for Edge and Microsoft WebDriver for Edge Legacy: 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 Preference (Eclipse) or Settings (IntelliJ) from the Parasoft 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.
Panel title Configuring WebDrivers on Windows 10 Panel title Configuring WebDrivers on MacOS
Microsoft 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 Command Line 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.
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.
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.