Architecture of Selenium WebDriver

In This Section, we are going to learn what is Selenium Web Driver and its Architecture.

What is Selenium Web Driver?

Selenium Web Driver is a Set of APIs Which Provides the functionality to interact with Different Web Browsers and to Automate User Interaction with Browers.

The Architecture of Selenium WebDriver

In Above Architecture it mainly consists of 3 blocks and instructions are sent over HTTP Protocol.

Selenium Client Library consists of languages like Java, Python, Ruby, C# and When executed with entire Selenium code it is converted to JSON Format and sent through HTTP protocol.

Selenium Client Library:-

it contains the APIs and the code necessary to implement Selenium Script and Libraries are specific to each language binding, in our case we are using Java language to compile and execute selenium automation.

Selenium WebDriver:-

Selenium WebDriver Is Used for Automating Testing on Web Application Via Browser. An HTTP request for Each Selenium Instructions is Generated from Execution Script and is Sent to the Web Browser of that specific WebDriver For Completing the requested operation on Browser.

Browser:-

it receives Instruction from Selenium WebDriver to Specific Browser and executes the specific instructions and sends back a response to WebDriver Which inTurn Send it Back to Execution Script.

Example:-
WebDriver driver = new ChromeDriver();// Create Instance for Chrome Web Driver 
driver.get("https://www.google.com");//Url Request Form Chrome Driver

When we Execute the Above Program It Will Creates an Instance of Chrome Driver and Requests for google.com

And Internally what would happen is when we click on run every Instructions will be converted to Url with the help of JSON and will be sent over HTTP To Chrome Web Driver.

Then the Chrome Web Driver will pass that request to the Chrome Browser over HTTP then selenium script commands execute on the Chrome browser.

then the corresponding response generated at the browser end will be sent to Web Driver then to Execution Script Output Part in Eclipse IDE.

This was the Working of Selenium WebDriver Architecture.