Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Selenium WebDriver installation process is completed in four basic steps:

1. Download and Install Java 8 or higher version and set Java Home Path in System variables.
2. Download and configure Eclipse.
3. Download Selenium WebDriver Java Client
4. Configure Selenium WebDriver

INSTALLATION STEPS OF SELENIUM:

1) Download JDK

1.1)Download JDK from the official website.

https://www.oracle.com/java/technologies/downloads/#java11-windows

Install the above executable file by double clicking on it and accept the terms and condition.

Set the Java Home Path inside the Environment variable by following step 2-3.

2) Go to C drive->Program Files->Java-> JDK X(where x is the version which you have


installed).Copy the path as below screenshot:
3) Navigate to the Control Panel, then to the “System and Security” and then the “System”. Click
on the “Advanced System Settings” from the left panel. This will land you to the System
Properties page. Click on the “Environment Variable” button.

Click on the “New” button on the System Properties section and add the copied path from Step2
on the “New System Variable” pop-up and click on OK button.
2. Download Eclipse

2.1 : Download the Eclipse from the official website. [https://www.eclipse.org/downloads/]. Click on
the “Download Packages” and then download the “Eclipse IDE for Java Developers” version based on
your OS.
Once the file is downloaded, double click and install it. Enter the workspace and then click on Launch
button.

Now create 1 Java Project. Create a new project through File > New > Java Project. Name the project as
“newproject”.

A new pop-up window will open enter details as follow

 Project Name
 Location to save project
 Select an execution JRE
 Select layout project option
 Click on Finish button

4. In this step,

 Right-click on the newly created project and


 Select New > Package, and name that package as “newpackage”.

A pop-up window will open to name the package,

Enter the name of the package


Click on Finish button
5. Create a new Java class under newpackage by right-clicking on it and then selecting- New >
Class, and then name it as “MyClass”. When you click on Class, a pop-up window will open,
enter details as
 Name of the class
 Click on Finish button

3 Download the Selenium Java Client Driver:

You can download Selenium Webdriver for Java Client Driver here. You will find client drivers for other
languages there, but only choose the one for Java.

This download comes as a ZIP file named “selenium-4.4.0.zip”. For simplicity of Selenium installation on
Windows 10, extract the contents of this ZIP file on your C drive so that you would have the directory
“C:\selenium-4.4.0\”. This directory contains all the JAR files that we would later import on Eclipse for
Selenium setup.

STEPS TO ADD LIBRARIES:

1. Right-click on “newproject” and select Properties.


2. On the Properties dialog, click on “Java Build Path”.
3. Click on the Libraries tab, and then
4. Click on “Add External JARs..”
5. When you click on “Add External JARs..” It will open a pop-up window. Select the JAR files you
want to add.
6. After selecting jar files, click on OK button.
7. Select all files inside the lib folder.
8. Select files outside lib folder.
9. Once done, click “Apply and Close” button
10. Add all the JAR files inside and outside the “libs” folder.
11. Finally, click OK and we are done importing Selenium libraries into our project.

STEPS TO ADD THE TESTNG PLUGIN

1. Launch Eclipse.
2. On the menu bar, click Help.
3. Choose the “Install New Software…” option.
4. Search the TestNG using the Find option and,
5. Click on the installation button. Confirm the installation process.
6. Click on confirm button
7. Accept the license agreement
8. Select the radio button “I accept the terms of the license agreement”.
9. Click on Finish.
10. It will take time depending on your Internet speed.
11. After accept the licence agreement,
12. wait for installation. Ignore security warning if occurs
13. If you encounter a Security warning, just click “Install Anyway”. Finish the installation and restart
your system.
14. Wait for the TestNG install in Eclipse to finish. When Eclipse prompts you for a restart, click
“Restart now.” Verify if the installation is done properly.
15. After the restart, verify if TestNG for Eclipse was indeed successfully installed. Click Window >
Show View > Other.
16. Then open the Java directory and see if TestNG is included.

That’s it on how to add TestNG in Eclipse.

NOTE: After TestNG installation to the Eclipse we should add the TestNG Library or Jar files to all the
projects in eclipse. In order to add it,RC on the Project folder-> Go to Build Path &select Add Libraries,
select TestNG &click on Next &Finish.

ChromeDriver Downloads

3. Ensure Google Chrome is installed in a system.


4. ChromeDriver expects you to have Chrome installed in the default location for your platform.
5. Download the ChromeDriver binary for your platform under the downloads section of this site.
[ https://chromedriver.chromium.org/downloads]
6. specify its location via the webdriver.chrome.driver system property as below.

JDK Installation https://www.oracle.com/java/technologies/downloads/#java11-windows


Eclipse Installation https://www.eclipse.org/downloads/
Selenium Java Client Installation https://www.selenium.dev/downloads/
TestNG Installation https://www.guru99.com/install-testng-in-eclipse.html
chrome driver https://chromedriver.chromium.org/downloads
Creating the TestNG project
https://www.guru99.com/all-about-testng-and-selenium.html
folder
https://testersdock.com/first-selenium-script/

You might also like