How to install Webdriver Chrome
WebDriver Chrome
Go to the page https://chromedriver.chromium.org/downloads and select your browser version. At the time of writing this guide, the version of our browser is 120.0.6099.71 (Official build, 64 bit), you can see your version in the browser settings (Settings - About Chrome). If your version is 114 or older, stay on this page and download the appropriate driver. For versions newer than 114, you need to go to the page https://googlechromelabs.github.io/chrome-for-testing/, select the stable version of chrome driver in the table (in our case 120.0.6099.71), select the system and bitness (for us, it’s win64), follow the link and download the archive of the required driver:
Extract the archive to a location convenient for you; to do this, create a folder and place the unzipped files there, remember the path to this folder. Set the path to Webdriver in an environment variable.
On Windows:
Open Control Panel.
Go to System and Security – System – Advanced system settings (or enter Change environment variables in the search bar, System Properties will immediately open to you).
Click “Environment Variables”.
In the “Environment Variables” section, find the Path variable in the “System Variables” section and select “Edit”.
Click “New” and add the path to the directory containing WebDriver (for example, C:\path\to\driver).
On macOS:
Open Terminal.
Use the command sudo nano /etc/paths to edit the PATH variable.
Add a new line with the path to the directory containing WebDriver (for example, /path/to/driver).
Press Ctrl + X to save changes.
On Linux:
Open Terminal.
Edit your ~/.bashrc or ~/.bash_profile file.
Add a line with the path to the directory containing the WebDriver (for example, export PATH=$PATH:/path/to/driver).
Run source ~/.bashrc or source ~/.bash_profile to update your environment variables.
Adding the path to the directory with WebDriver to an environment variable is convenient for multipurpose access, you will be able to use WebDriver from anywhere on your system without having to specify the full path to the executable file in the code, and also in the future, if you need to update the webdriver, you will only need to update the environment variable without changing the code.
Edge and other browsers
To install the Edge driver, go to https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver, after checking the version of your browser (Settings and more - Settings - Microsoft Edge information) and download the same driver version suitable for your system. Set the path to it in an environment variable in the same way as we did for the Chrome driver. For other browsers, follow the same steps. Instructions for installing the driver for Firefox are here, you can download it here, WebDriver for Opera you can download here.
Note: We'd like to remind you that the product is used to automate testing on your own websites and on websites to which you have legal access.