×

Selenium WebDriver installation

Installation Steps of Selenium WebDriver

In this tutorial, we will see the process of selenium webdriver installation.

Selenium WebDriver installation process is done in four Stages:

  • Java Installation (version 8 or higher version)
  • Eclipse  Installation and configuration
  • Download Selenium WebDriver
  • Import web driver jar into the Eclipse project.

Java Installation

We expect that you have already installed Java (version 8 or above) on your system and configure the environment variables required to run and compile the Java programs successfully.

Note: To use Selenium 3, we will need to install Java 8 in our system.

For downloading the latest version of the Java Development Kit (JDK), you can refer the following link: https://www.oracle.com/technetwork/java/javaSE/downloads/index.html

While clicking on the above link, we will see the below screen, where we have to download the JAVA SE 8u22 version.

Remember one thing that downloads only JDK.

Installation Steps of Web Driver

Once you downloaded and installed the latest version of Java, and to set the path or configure the environment variable in your system, we will move to our next stage, i.e.

Eclipse Installation and configuration

To install Eclipse following steps are as follows:

Installation Steps of Web Driver 1
  • After click on the Download Packages section, select Eclipse IDE for Java Developers because Eclipse comes with multiple tools like Java, java bean, C++, and PHP.
  • And select one of the options between Window 64 bit, macOS 64 bit, and Linux 64 and download it.
  • And we have window 64-bit compatibility in our system, so we click on the window 64 bit.
Installation Steps of Web Driver 2
  • The downloaded file comes up with the zipped format.
  • Extract/unzip the contents in the desired directory.
Installation Steps of Web Driver 3
  • Then, double click on eclipse [.exe file].
Installation Steps of Web Driver 4
  • To configure the workspace, select any available directory where we want to save all of our Selenium test scripts.
  •  After that, click on the launch button.
Installation Steps of Web Driver 5
  • The default interface of Eclipse IDE is launched, which is as shown below:
Installation Steps of Web Driver 6

After that, we will download selenium webdriver for java which is shown below in the next phase

Download Selenium WebDriver Java Client

  • Go to the Google search to download Selenium.
  • Click on the first link to navigate the Selenium community.
Installation Steps of Web Driver 7
  • After that, click on the download button.
Installation Steps of Web Driver 8
  • Now scroll down your web page and go to the selenium client & web driver language bindings and click on the download button for java client driver, which is shown in the below screenshot:
Installation Steps of Web Driver 9
  • Then, the downloaded file comes in the zipped format.
  • Unzip the folder in the desired directory.
  • It contains all the jar files which are required to configure Selenium WebDriver in Eclipse IDE.
Installation Steps of Web Driver 10

Configure Selenium WebDriver

Now we will configure Eclipse IDE with Selenium WebDriver.

  •  First, we will create a new Java Project in Eclipse and load all the jar files to develop Selenium Test Scripts.
  • Open Eclipse IDE with a new workplace.
  •  To create a new java project, click on fileà newà java project.
Installation Steps of Web Driver 11
  • Give your Project name as new_test, leave the other fields as it is, click on the Finish button.
  • The new Java project will be created with the following directories.
Installation Steps of Web Driver 12
  • Now we have to create a package for a newly developed project.
  • Right-click on the project and select a new>package and name the package as testpackage.
Installation Steps of Web Driver 13
  • After that, create a new Java class under testpackage by right-clicking on it.
Installation Steps of Web Driver 14

When you click on Class field, a pop-up window will open, then enter details as

  • Name of the class
  • Click on the Finish button.
Installation Steps of Web Driver 15

Note: Selenium Test Scripts always are written in .class file in Java. Here the project new_test act as a test Suite that may contain one or more Selenium test cases/test scripts.

  • After successfully creating a class, the below window appears:
Installation Steps of Web Driver 16
  • Now, we add the Selenium jar files in the Test Suite (new_test).
  • Right-click on the new_test folder and click on Properties field.
Installation Steps of Web Driver 17
  • Then click on Java Build Path from the left-hand side panel.
Installation Steps of Web Driver 18
  • And then move to Libraries field, and click onthe Add External JARs button.
Installation Steps of Web Driver 19
  • It will locate you to the directory where we have downloaded the Selenium jar files, select the individual jars, and click on the Open button.
Installation Steps of Web Driver 20
  • Follow the same process to upload the jars of the libs folder.
  • Open the libs folder and select all the respective jar files and click on the Open button.
Installation Steps of Web Driver 21
  • After that, we will get all the Selenium jar files in our Libraries field, then click on Apply and Close button.
  • Below snapshot shows the directory structure of our new_test Test suite after adding Selenium jars files.
Installation Steps of Web Driver 22

Hence, we have successfully installed the Selenium WebDriver with Eclipse IDE. Now we can write our test script in eclipse and run through web driver.

 

 


Related Topics

Selenium Testing

Selenium is a functional testing tool and compatible with non–functional testing tool. Selenium is free and not required any licensing. There are specified types of testing that can be automated using Selenium:-   Functional Testing: Checking every component...

3 minutes read.

CSS Selector: ID/Class and Attribute in Selenium IDE

CSS SELECTOR: ID/Class and Attribute The Id, class, and attribute of CSS selector are used to identify the web element to access the web pages.  Syntax for Id/Class and Attribute: css= <./#> {[attribute=Value of...

2 minutes read.

Selenium-IDE Login test

Login test for Selenium-IDE Now we are learning, how to create a Login/sign-up Test case in Selenium IDE. For our testing purpose, we are going to test the login page provided by...

2 minutes read.

Selenium WebDriver-CSS Selector: Tag and Attribute

Selenium WebDriver-CSS Selector: Tag and Attribute We will locate the web element with the help of Tag and attribute CSS selector in this section of the tutorial. Where Tag and attribute are...

5 minutes read.

Selenium WebDriver-CSS Selector: Substring Matching

CSS Selector: Substring Matching Selenium WebDriver In this tutorial, we will learn how to identify the web element using the substring method. A Sub-string contains three methods for identifying the web element...

9 minutes read.

Selenium WebDriver Tutorial

Seleniun WebDriver Introduction Selenium WebDriver is the essential tool of Selenium Tool Suite because it can directly communicate the browser without any server.  Selenium WebDriver is a browser automation framework that accepts...

3 minutes read.

Selenium WebDriver-CSS Selector: Tag and Class

Selenium WebDriver-CSS Selector: Tag and Class We will locate the web element with the help of tag and class CSS selector in this section of the tutorials Where Tag and class are...

4 minutes read.

Selenium WebDriver Commands

Selenium WebDriver Commands: As we learn previously in the Selenium-IDE tutorial, Selenium commands are the set of commands that are used to run a Selenium test script. But whereas, Selenium WebDriver had...

2 minutes read.

WebDriver-Id Locator

WebDriver-Id Locator: The Id Locator is used to identify any web element in UI with the help of the ID attribute. The First preference is always goes to ID locator while inspecting...

4 minutes read.

WebDriver-Tag Name Locator

Selenium WebDriver-Tag Name Locator The tag name locator is used along with the findElements() method to identify multiple similar elements in the UI. It is used to locate the web element with...

3 minutes read.

Selenium-IDE Installation in Mozilla Firefox

A beginners guides to Selenium-IDE Installation Since Selenium IDE is designed only for Firefox and Chrome plug-in, we are assuming that you have already installed the Mozilla Firefox browser in your...

1 minute read.

WebDriver-Link Text locator

WebDriver-Link Text locator The Link text locator is used to identify only web link elements based on the value of the link. The Link text locators cannot be used for other than...

4 minutes read.

Selenium WebDriver-Locators

Selenium WebDriver-Locators The WebDriver uses the same set of locating strategies like selenium -IDE for specifying the location of the web element. Each locating strategy has its command in Java to locate...

1 minute read.

Selenium Assertion

Selenium Assertion: In this section, we will learn about the Assertion in Selenium WebDriver. An Assertion is a feature available in TestNG, which is used to verify the expected result of...

7 minutes read.

Name Locator in Selenium IDE

NAME LOCATOR: It is used to find the name in the web element. If we have multiple web elements of the same name, then the first matched element would be returned. Open the...

3 minutes read.

Verification Controls Methods in Selenium WebDriver

Verification Controls Methods  The verification controls methods are used to check whether the web element is displayed, enabled, and selected. Some of the most commonly used verification controls are as follow: Verification controls Description Return...

4 minutes read.

Selenium WebDriver &ndash; Web Element Controls

Selenium WebDriver – Web Element Controls A web element is an interface that is implemented by a remote web element class. The Web element control can be used to perform the data...

1 minute read.

Selenium WebDriver &ndash; Window handling

Selenium WebDriver – Window handling In this tutorial, we will understand how we can handle the window, multiple windows, and pop-ups in selenium WebDriver. We have different types of window, and pop-ups...

7 minutes read.

CSS Selector: Sub String in Selenium IDE

CSS Selector: Sub String CSS Selector Sub-string is used to match a partial string to locate a particular web element. There are three ways to match a substring using a CSS Selector. Match...

2 minutes read.

Operational Controls Methods in Selenium WebDriver

Operational Controls Methods The Operational controls are used to perform all the actions on the web elements like click on the button, pass the value in the text box, and click...

4 minutes read.