Selenium Installation
Selenium WebDriver
Habtamu Petros
Last Update há 4 anos
Selenium WebDriver is a web framework that permits you to execute cross-browser tests. This tool is used for automating web-based application testing to verify that it performs expectedly. Selenium WebDriver allows you to choose a programming language to create test scripts.
Step By Step Selenium Installation
The process of installing Selenium involves 3 steps:
- Install Java
- Install Eclipse IDE
- Install Selenium WebDriver
Java is one of the most widely used languages for Selenium. The first step, needed for Java installation, is configuring the Java environment so that later on, Java codes can be used to drive the selenium.
Install Java
To complete your Java installation follow below steps .
- Go to www.oracle.com/java/technologies/downloads on this page and click on the option for Java Platform (JDK).

- You can run the installer once the download is over and follow the onscreen instructions.
- Go to start and search for ‘System’
- Click on ‘System’
- Click on ‘Advanced system settings’
- Click on ‘Environment Variables’ under ‘Advanced’ tab as shown below:

- Next, under system variables choose new and enter the variable name as ‘JAVA_HOME’ and the full path to the Java installation directory as per your system as shown below:

- The below figure depicts the configuration of the environment variable name and value.

- The next thing that you have to do is to configure your environment variables. Here, you have to edit the path of the system variable as shown below.

- Under ‘Variable value’, at the end of the line, enter the following path – %JAVA_HOME%bin; Now, you can click ‘OK’ and you are done.
- Now to cross-check the installation, just run the following command in cmd – java -version. It should display the installed version of Java in your system.
Install Eclipse
To configure Eclipse on your system follow below steps:
- Navigate to the following URL – https://www.eclipse.org/downloads/ and select the download link depending on your system architecture – (32 Bit or 64 Bit) and download it.

- Once the download is over, extract the zipped file and save it to any directory. The root folder is the eclipse.

- Open the folder and launch eclipse.exe.

Install Selenium Web Driver
- Open the browser and navigate to https://www.selenium.dev/downloads

- Extract the zip file and save it in your selenium folder.
- Next, you have to download Chrome Driver for Google Chrome and Gecko Driver if you are using Mozilla Firefox.
- On the same downloads page, scroll further down and you will find the third-party drivers section. There you will find options for downloading gecko driver and chrome driver as shown in the below figure.

- On the next page, you will find the latest version available. You can choose that and download based on your system configuration. You can refer to the below image for your OS configuration.

- You can simply download the driver, extract the zip file and save it in any location. Similarly, you can download the latest version of gecko driver and save it if you are using the Mozilla browser.
- Next, you can simply create a new project in Eclipse IDE and add all the external selenium jar files from the selenium lib directory.


3. Then, you should add referenced libraries to your project. Click on your project -> Build Path -> Configure Build Path and add external JARs as shown in the figure.

4. create a class file and give public access modifier

Now you are all set to execute the first Selenium program. You can run the below script and check the output.
