Testing.

Sunday, 17 February 2019

Selenium Webdriver tutorial: What is selenium webdriver and how it works ? Architecture of selenium webdriver.


Selenium webdriver is a set of libraries and APIs which interact with web application. It is used for automating browser and testing the application is working as expected or not.

In simple words we can say selenium webdriver is a browser automation framework that accepts commands as a script and send it to the browser to mimic as real user.
Architecture of Selenium WebDriver:


There are four components are there in Selenium WebDriver components:
  1. Selenium Language Buildings
  2. JSON Wire Protocol
  3. Browser Drivers
  4. Real Browsers
1. Selenium Language Buildings

As we know selenium supports multiple libraries like Java, Ruby, Python, C# etc. for that selenium developers have developed language buildings to allow selenium to support multiple languages. We can download all supported languages buildings from official website (https://www.seleniumhq.org/download/#client-drivers) of selenium.
2. JSON Wire Protocol

JSON (JavaScript Object Notation) is used for transferring data between server and a client. JSON wire protocol is a REST API that transfer the information between HTTP Server. Each browser driver (such as firefoxDriver, ChromeDriver, EdgeDriver...ect) have their own HTTP server.

3.  Browser Drivers

Each browser have their own browser driver. Browser driver establish the secure connection with the browser without revealing the internal logic of browser's functionality. When browser driver receives any commands then that command is executed on that respective browser and response will go back in the form of HTTP response.

  • When we execute test script using Webdriver HTTP request is generated and send to the browser driver for each selenium command.
  • The driver receives HTTP request through HTTP server.
  • HTTP server decides all steps to perform instruction which are executed on browser.
  • Each execution status is sent back to the HTTP server which is subsequently sent back to the automation script.

4. Real Browsers

Browsers supported by Selenium WebDriver:

  • Firefox browser
  • Chrome browser
  • Edge browser
  • Safari browser
  • Opera browser 

No comments:

Post a Comment