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 (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. 

Downloading WebDrivers

Download the correct WebDriver for your browser version. 

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.

  1. Choose Parasoft> Preferences from the Eclipse menu.
  2. Choose Selenium WebDriver from the Parasoft sidebar menu.
  3. 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 10

    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.

  4. 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.:

Chocolaty for Windows
choco install chromedriver

  

brew for macOS
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.

  1. Click the Windows start menu and choose Windows System> Control Panel.
  2. Click System and Security.
  3. Click System.
  4. Click Advanced system settings.
  5. Click Environment Variables and double click the Path entry in the System variables panel.
  6. Choose the C: drive variable and click Edit.
  7. Add a semicolon (;) and specify the directory containing the WebDriver executable.
  8. Click OK to save the edit and click OK to close the Environment Variables panel.
  9. Click OK to close the System Properties panel.
  10. Restart Windows.

MacOS

  1. Open Terminal and open /etc/paths in an editor as an administrator, e.g.: 

    sudo vim /etc/paths
  2. Enter you password when prompted.
  3. Add the path to the directory containing your WebDrivers to the file.
  4. Save and close the file.
  • No labels