Here, we shall download and install the drivers for the Chrome browser. The aim is to understand how to download and install browser drivers as a prerequisite of Selenium automation. The steps for completion of this process are as follows:
- Browse to http://www.seleniumhq.org/download/ to download the browser drivers from SeleniumHQ.
- Download Google Chrome Driver:
Downloading the IE and Firefox drives is optional, as we will only use Chrome throughout the remainder of the book.
- Unzip the downloaded files into a folder of your preference (such as C:BrowserDrivers).
- Optionally, add the folder referenced in the previous step (for example, C:BrowserDrivers) to the system path. This will allow the driver to start without the need to include its location in every automation script that uses it.
- For Windows, run the following command on a console window:
set PATH=$PATH;path ochromedriver
For Linux and macOS, run the following command on a console window:
export PATH=$PATH:/path/to/chromedriver