×

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 commands and sends them to the browser.  
  • It was developed by JSON Huggins and Simon Stewart from Google Company in 2008.
  • Web driver is implemented through a browser-specific driver
  • Selenium WebDriver comes under Selenium version 2, which provides a simple and brief programming interface. 
  • Selenium2= WebDriver+ Selenium 1.0, where selenium 1.0 version includes Selenium IDE, Selenium RC and Selenium Grid.
  • WebDriver is a collection of core java libraries and interfaces.
  • The Selenium WebDriver test scripts can be developed by any supported programming languages and can be run directly in web browsers.
  • The programming languages that are supported by WebDriver include C#, Java, Perl, PHP, Python, and Ruby.
Web driver Introduction

WebDriver execution is faster as compared to Selenium RC because selenium RC needs a selenium server to interact with the browser whereas WebDriver directly interacts with the web browser without any need of selenium server.

Before going further to the concepts of Selenium WebDriver, we should know any supported programming languages. Presently, Selenium WebDriver is in demand with Java and C#.

Here, we are performing a Selenium WebDriver with the java programming language.

To learn basic and advanced concepts of java and C# programming language, you can refer to the below links:

Java Tutorial: https://www.tutorialandexample.com/java-tutorial

C# Tutorial: https://www.tutorialandexample.com/csharp-tutorial

Firefox (Gecko Driver) WebDriver has a built-in implementation. And we need plug-ins to other browsers for specific drivers to communicate and run the test scripts.

Browsers supported by WebDriver is as following:

  • Google Chrome Browser
  • Mozilla Firefox
  • Internet Explorer Browser
  • Safari Browser
  • Microsoft Edge Browser
Web driver Introduction 1

Architecture of Selenium WebDriver

There are four necessary components of Selenium WebDriver Architecture:

  • Selenium Language Bindings
  • JSON Wire Protocol
  • Browser Drivers
  • Real Browsers
Web driver Introduction 2

Selenium Language Bindings/Client libraries:

Selenium supports multiple languages like Java, Ruby, Python, etc.; Developers have developed language bindings to allow Selenium to support various libraries. Once you go through the test (the complete selenium code), which we have written, that has to be converted into JSON format.

We can download the supported language bindings with the help of the below link.

https://www.seleniumhq.org/download/#client-drivers

JSON Wire Protocol:

JSON stands for JavaScript Object Notation. It is used to exchange data on the web. JSON files are sent to the browser driver, which is also known as the server through HTTP protocol. And each Browser Driver like- Firefox Driver, Chrome Driver, has its HTTP server.

Note: Each browser contains a separate browser driver.

Browser drivers:

Selenium WebDriver are specific to each browser and establish a secure connection with the browser without disclosing any internal functionality of the browser.

The browser driver communicated with its respective browser and executed the command by interpreting JSON, which is a receiver on the browser. And response will go back in the form of http.

While executing a test script with the help of WebDriver, the following activities performed internally:

  • For each Selenium command, the HTTP request generated and sent to the browser driver.
  • The driver receives the HTTP request with the help of the HTTP server.
  • The HTTP Server performed all the steps and instructions which are executed on the browser.
  • In the last activities, the execution status sent back to the HTTP Server.

Real Browsers:

The browser driver receives a response from the browser and JSON response to the client.

Browsers supported by Selenium WebDriver:

  • Internet Explorer
  • Mozilla Firefox
  • Google Chrome
  • Safari
  • Microsoft Edge

 

 

Selenium Web-driver Topics


Related Topics

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...

4 minutes 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 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.

CSS Selector: ID in Selenium IDE

CSS Selector: ID The id attribute is used to identify the web element uniquely in the web pages. Syntax of ID Attribute:  [HTML tag][#][Value of ID attribute] The hash sign (#): it is mandatory while using the...

1 minute read.

Selenium Wait

In this tutorial, we will understand how we can avoid synchronization issues while executing the test script in a selenium WebDriver. Before going further in this tutorial, first, we will understand that...

10 minutes read.

Selenium WebDriver- Checkbox handling

Selenium WebDriver- Checkbox handling In this tutorial, we will be learning about handling the checkbox in selenium WebDriver. Let us take one example to give you a better understanding of Checkbox handling,...

4 minutes 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.

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.

Mouse and Keyboard Controls in Selenium WebDriver

Mouse and Keyboard Controls in Selenium WebDriver In this tutorial, we will learn about how to handle mouse and keyboard event using action class in selenium WebDriver. Action Class in Selenium WebDriver: Action...

13 minutes read.

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: Attribute in Selenium IDE

CSS Selector: Attribute Locating the attribute of a CSS selector, we would access the Password textbox, which is present in the login form of Facebook. The Password textbox has a type attribute...

1 minute read.

Selenium WebDriver- Radio button handling

Selenium WebDriver- Radio button handling In this tutorial, we will be learning about handling the radio button in selenium WebDriver. Let us take one example to give you a better understanding of...

3 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.

Data-Capture Controls Methods in Selenium WebDriver

Data-Capture Controls Methods: The data-capture controls are used to determine the text, size, location, and the CSS value of the web element, etc. Some of the most commonly used data-capture controls are...

7 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 - Navigation Controls Commands

Navigation Controls Commands in Selenium WebDriver WebDriver is used to hold the browser history and perform browser navigation operations like, back, forward, and refresh. Whenever a WebDriver launches a browser, all...

5 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 WebDriver - Browser Controls Commands

Selenium WebDriver - Browser Controls Commands WebDriver includes operations like opening a browser, fetch the title, and closing the browser, etc. Some of the most commonly used Browser controls commands for Selenium WebDriver...

6 minutes read.

Selenium WebDriver-CSS Selector: Tag Class and Attribute

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

5 minutes read.

CSS Selector: Class in selenium IDE

CSS Selector: Class Identify a web element with the help of Class as a CSS Selector is like using id attribute. The only difference between Class and id is in their...

2 minutes read.