Download & Install Selenium WebDriver (with Screenshots)
Download & Install Selenium WebDriver for Java
To connect Selenium WebDriver in Java, you have to follow the three steps below.
- Java JDK
- Eclipse IDE
- Selenium Driver Files
Install Java SDK
The first step is to install Java JDK which you can download from the official Oracle website. The latest version currently available is Java SE 14 which you can download here.
Click on JDK Download to download the file onto your machine.
Once you download the file start the installation.
After you complete the installation prepare environmental variables – only applicable for windows operating systems. Go to system properties and click on Environmental Variables, then click New and give the bin path from the Java installation files.
After setting the environmental variable, to confirm that the installation is a success, open the command prompt and type ‘java’. You will see the module parameters and that’s your confirmation for a successful installation.
Install Eclipse IDE
The second step is to install an IDE for Java development - Eclipse. You can download the Eclipse IDE from the official eclipse website. As the below image shows, click the download file and save the executable installation file in your device. Then install it.
When installing make sure you select ‘Eclipse IDE for Java Developers’ and follow the normal installation process.
You can Launch the Eclipse IDE once you complete the installation.
Install Selenium Java Client WebDriver
The final step is to install the Selenium WebDriver for Java. You can download Selenium Web client from Selenium official website.
Selenium is available for other programming languages as well. We will download it for Java and save the file in our device – it will be a zip file.
Extract the zip file to any location for future access.
Now let’s see how to import the Selenium WebClient to Eclipse IDE. Open Eclipse IDE, select Launch with default workspace location.
Create a new Java Project and give a suitable name.
Once you create a new project, right-click on the project and create a new package for it and give a suitable name.
After you create the package, right-click on the package and create a new class with a suitable name.
Now, right-click the project and select properties and click on the Libraries tab after selecting Java Build Path on the left.
Click on Add External JARs.. and navigate to the path where you extracted the Selenium files. Select all the files inside the libs folder and outside.
You can see the files that you selected in the navigation panel as well. Now click on Apply and Close. That’s it! All the selenium WebClient applications can be used with Java.
Start the executable file to install NodeJS in your device.
Once you complete the installation, you have to set the environmental path for the NodeJS installation files. Open System Properties and click Environmental Variables. Click on the path and select New, then give the path location for the NodeJS installation file.