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
WebDriverimplementation that supports their favorite browser. - If our developers must use a specific browser, we can use the
WebDriverimplementation which supports that browser.
Additional Reading:
- Selenium WebDriver Documentation: Driver Specifics and Tradeoffs
explains the pros and cons of different
WebDriverimplementations.
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:
- Download the driver executable.
- Extract the compressed driver executable.
- Ensure that Selenium WebDriver finds the extracted driver executable. We can do this by using one of these two options:
- We can put the extracted driver executable to our
PATH. - We can configure its location by setting the value of a driver (browser) specific system property when we configure our end-to-end tests.
Additional Reading:
Because the examples of this course use Chrome, we can install the required driver executable by following these steps:
- Download the latest ChromeDriver version.
- Unzip the downloaded ZIP file.
- Ensure that Selenium WebDriver finds the extracted ChromeDriver executable. We can do this by using one of these two options:
- Put the extracted ChromeDriver executable to our
PATH. - Configure the location of the ChromeDriver executable by setting the value of the
webdriver.chrome.driversystem property.
Additional Reading:
- ChromeDriver: Getting Started provides a more detailed description of the setup process.
- ChromeDriver: Getting Started - Sample Java Test
demonstrates how you can configure the location of the extracted driver executable by setting the value of the
webdriver.chrome.driversystem property.
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
WebDriverinterface. - 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.