Installing the Required Prerequisites

After we have finished this lesson, we

  • Understand how we can select the required driver executable.
  • Know how we can install the selected driver executable.

This lesson assumes that:

Note that this lesson has no video because this lesson consists mainly of links to other web pages that can be hard to find from the official website of Selenium WebDriver.

Let’s start by finding out how we can select the required driver executable.

Selecting the Required Driver Executable

The required driver executable depends from the implementation of the WebDriver interface that is used by our end-to-end tests. If we use our end-to-end tests as smoke tests, most of the time we can use any implementation of the WebDriver interface. If this is the case, we can select the used WebDriver implementation by following these rules:

  • If our developers can install any browser they want, we can use the WebDriver implementation that supports their favorite browser.
  • If our developers must use a specific browser, we can use the WebDriver implementation which supports that browser.

Additional Reading:

Next, we will find out how we can install the required driver executable.

Installing the Driver Executable

If we are installing a driver executable for a desktop browser, we can install the preferred driver executable by following these steps:

  1. Download the driver executable.
  2. Extract the compressed driver executable.
  3. Ensure that Selenium WebDriver finds the extracted driver executable. We can do this by using one of these two options:
  4. We can put the extracted driver executable to our PATH.
  5. We can configure its location by setting the value of a driver (browser) specific system property when we configure our end-to-end tests.

Because the examples of this course use Chrome, we can install the required driver executable by following these steps:

  1. Download the latest ChromeDriver version.
  2. Unzip the downloaded ZIP file.
  3. Ensure that Selenium WebDriver finds the extracted ChromeDriver executable. We can do this by using one of these two options:
  4. Put the extracted ChromeDriver executable to our PATH.
  5. Configure the location of the ChromeDriver executable by setting the value of the webdriver.chrome.driver system property.

Additional Reading:

Let’s summarize what we learned from this lesson.

Summary

This lesson has taught us three things:

  • If we use our end-to-end tests as smoke tests, most of the time we can use our favorite implementation of the WebDriver interface.
  • We can ensure that Selenium WebDriver finds our driver executable by putting the driver executable to our PATH.
  • We can configure the location of the driver executable by setting the value of a driver specific system property when we configure our end-to-end tests.