How to Install Selenium Webdriver for Java in Eclipse
Requirements
System requirements:
- Any OS: Ex: Windows, MAC, Linux (I use Windows)
- RAM: Min 1GB (Recommend- Min 2–4 GB)
- Hard diisk — Min 500 MB (Recommend min 10 GB)
Other requirements:
- User with admin rights — We have to do some path variable changes and it required admin rights
- Web browser
- Active internet connection
Step 1 — Download Java JDK (current version 18)
Download and Install Java
- Go to the Java download page and download the latest version
Link: https://www.oracle.com/java/technologies/downloads/#jdk18-windows
2. Install the java by clicking on the downloaded .exe file and following the steps
Get the Path Variables
To set the path variable you’ll need two variables.
- User variable (this required the path of the base directory)
- Go to the C drive
- Open the ‘Program’ folder
- Open Java folder
- Go to the jdk folder
- Copy the path (ex: C:\Program Files\Java\jdk-18.0.1.1)
2. System variable
- Go to the C drive
- Open the ‘Program’ folder
- Open Java folder
- Go to the jdk folder
- Open the binary folder
- Copy the path (ex: C:\Program Files\Java\jdk-18.0.1.1\bin)
Set the Path Variables
- Go to my computer
- Right-click on it
- Select properties
4. It will navigate you to the system settings, Click on advance system settings
5. Click on advanced and Environment variables
6. Click new to create a new user variable
7. Give the name and path and click ok to create a user variable
8. You’ll see a variable called Path in system variables
9. Select it and click on the Edit button. DO NOT DELETE ANY VALUES IN THERE. Click on new to the add the path
10. Add the path and click ok to save it
11. Click ok for all popups till they close (You’ll have 3 popups)
12. To confirm the installation of Java, Open the command prompt and type ‘java -version’ to see the installed version
Step 2 — Download Eclipse
- Go to the download page of Eclipse
Link: https://www.eclipse.org/downloads/
2. Click on the download button and wait till download it
3. install the Eclipse
Step 3 — Download selenium
- Go to the download page of Selenium
Link: https://www.selenium.dev/downloads/
2. Download the latest version
After download, the selenium add the .jar file to the project to start with Selenium
Step 4 -Download Browser Driver
Since we plan to use the Chrome browser to run the test, download the chrome driver. Also check the chrome version on your computer before downloading it (Mine is 102.0.5005.63)
- Go to the Chrome driver download page
Link: https://chromedriver.chromium.org/downloads
2. Select the driver version similar to Google Chrome that you have installed on your computer
3. Download the zip file that is compatible with your OS
4. After downloading, extract the zip file anywhere you like