Selenium WebDriver Architecture – Overview
Selenium WebDriver follows a client-server architecture and allows direct communication between test scripts and browsers.
Components of the Architecture:
Test Script (Client Layer)
Written in any supported language (Java, Python, C#, etc.)
Uses Selenium APIs
Selenium WebDriver
Acts as a bridge between the test script and the browser
Sends commands from test scripts to the browser driver
Browser Driver
Each browser has its own driver (e.g., ChromeDriver, GeckoDriver for Firefox)
Accepts commands via HTTP (JSON Wire Protocol or W3C protocol)
Converts commands into actions performed on the browser
Real Browser
Chrome, Firefox, Edge, Safari, etc.
Executes the actions like clicking, typing, navigating, etc.
Selenium Architecture Diagram
Working of Selenium Architecture:
Test script sends a command (e.g., click button).
WebDriver forwards it to the browser-specific driver.
The driver communicates with the browser via native APIs.
The browser executes the command.
Response is sent back via the same path.
