Course Content
Testing Tools
Testing Tools
0/1
Sample Python Programs
Sample Python Programs
0/1
Selenium Python First Script
Selenium Python First Script
0/2
HTML Form elements
HTML Form elements
0/1
Handle HTML Frames
Handle HTML Frames
0/2
Handling Dropdown Lists
Handling Dropdown Lists
0/2
Selenium Action class
Selenium Action class
0/1
Python Database Programming
Python Database Programming
0/1
Selenium Python for Beginners [ 2024 ]
About Lesson

Selenium WebDriver Communication

Let’s understand the communication flow of Selenium WebDriver and how it interacts with the browser using the JSON Wire Protocol.

The main component of Selenium, which is used in automation, is the Selenium WebDriver. 

  • The Client bindings/libraries are available in different programming languages.
  • JSON Wire Protocol over HTTP for communication to send commands from the client to the server
  • Driver for every browser
  • Browsers:  Chrome, Firefox, Edge, Opera, IE, etc.

Test Script 
The automation tester writes an automation test script using the Selenium client library in their preferred programming language.[ Python, Java, Ruby, etc.]

The test script sends commands through the client library to interact with the browser (e.g., clicking a button, filling out a form, etc.)

 

Selenium WebDriver Communication

JSON Wire Protocol

  • The client library converts these commands into JSON format.
  • HTTP Request: The converted JSON commands are sent over an HTTP request to the browser driver.
  • Driver—Browser Interaction: The browser driver decodes the JSON commands. It interacts with the web browser, executing the necessary steps (e.g., simulating a click, navigating to a URL, etc.).

Automation Script Feedback

The execution status (success or failure) is returned to the HTTP server. Finally, the HTTP server relays the status back to the automation script.

Selenium WebDriver communicates with the browser by creating HTTP requests, converting commands to JSON, and using the JSON Wire Protocol.