Special Offer - Enroll Now and Get 2 Course at ₹25000/- Only Explore Now!

All Courses
Selenium Web Driver

Selenium Web Driver

November 20th, 2018

Selenium WebDriver:

Selenium is the web-based testing tool which is an advanced version of Selenium RC. Selenium WebDriver was discovered by Simon Stewart and Jason Higgins in 2006. As we are aware of how Selenium IDE is limited to Firefox only. Selenium WebDriver has overcome this by enabling to execute tests in different browsers. Selenium WebDriver allows us to use any programming language in test scripting. WebDriver is an assemblage of open source APIs which are used to automate the testing of a web application.

WebDriver provides an easy to use the platform and a set of API’s which can read the script effortlessly, thus easier to read and maintain the scripts. It is purely an object-oriented interface with improved features and functionalities which were not present in Selenium RC. Thus it directly communicates with the browser avoiding the need to get Selenium server started before executing test scripts. Its updated version can even support iPhone and Android testing.

Advantages of Selenium WebDriver:

  • The most important advantage of WebDriver is its compatibility and scalability. WebDriver runs on multiple browsers. It directly communicates with the browser. There is no need for an intermediary between user and browser. Selenium WebDriver manages the browser from the OS level directly
  • It works with programming language’s IDE of your choice. Most popular are Eclipse and Netbeans. It supports multiple plug-in options which are also free.
  • WebDriver is faster since it does not interact with the browser, unlike Selenium RC. Browser communication is more interactive.
  • The wide range of platforms is supported by WebDriver. Even its installation is faster and simpler. We will discuss the installation later.
  • The execution time for test scripts is way faster than IDE and RC.
  • It can handle several testing frameworks such as JUnit, RSpec, TestNG, NUnit, UnitTest etc.

Selenium WebDriver Installation Process:

The installation of WebDriver needs to be accompanied by some basic tools. We will see the process in a simplified way without making it much complicated. To configure Selenium first and foremost step is to install the development kit. Here, we will use Java. First JDK (Java Development Kit) is to be installed.

Many computer devices come with JDK pre-installed now a day. So, its better to check first to save time. To check open the command dialog and hit “java”. Check whether the files are already installed or not. If not, then we will download it by clicking on this link

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

The variety of download options can be seen by going through this link. We will have to choose the relevant program compatible according to system configuration. Install according to the system on which you are working, whether it is 32bits or 64 bits. The first component of our WebDriver installation is now completed. Easy? Isn’t it?

The second step is to download Java Editor. The most popular used IDE is Eclipse. We will use the same. Eclipse can be downloaded from

https://www.eclipse.org/downloads/packages/release/oxygen/3a/eclipse-ide-java-developers-

The third step is to download the Selenium files. This is needed to configure Selenium to Java project. Just click on the link

https://www.seleniumhq.org/

On the download page, we will scroll on Selenium Client and WebDriver Language Binding; then select the desired client version. Here we will configure the Java version.

Here we have downloaded the chief components of Selenium WebDriver. One thing which we should pay heed to is that- It is mandatory to install Java first before extracting Eclipse otherwise it will not run. After successful completion of these steps, we will extract Eclipse and launch eclipse.exe directly. Right, click on Eclipse interface and Select New– Make a new Project by allotting it a name. Choose the Java Project and mention Project Name and click Finish. I will simplify what we have done until now. Simply put, we have done the following steps:

  • Installed JDK
  • Extract Eclipse
  • Configure Selenium JAR files.

The most important step is to extract Selenium Java zip to your Eclipse Project. Once you will complete this step, your only major task is to configure the build path. You will have to follow these steps;
Right click on Project then Select Properties after selecting click on Java build pathSelect the libraries and

Add External Jars
After adding JAR–> We are ready to Add New Package. Give this package a name and under this Package Add

New Class and mention the class name. Check on public static void main and click Finish
We have now configured WebDriver with Eclipse and Java. Again I will simplify it in most important steps. Simply put we have

  • Created new Project
  • Created a new Package
  • Created new Class
  • Add External libraries to the project

We have seen the complete installation process. Follow these steps and start your automation testing now. As more and more companies are moving towards automation testing. Selenium WebDriver acts as the most significant testing framework in finding bugs at the primitive stage. Its test script is reusable and easy to maintain. Due to its open-source nature, benefits of Selenium WebDriver are immense. With its suite of tools, it can easily cater to the need of modern day testing environment.