Testing / Selenium Interview questions
Explain the internal working of Selenium WebDriver?
When test code calls a WebDriver method, the language binding serializes it into an HTTP request following the W3C WebDriver protocol and sends it to a locally running driver executable (ChromeDriver, GeckoDriver, etc.) over a local port.
sequenceDiagram
participant T as Test Script
participant C as Client Binding
participant D as Driver Executable
participant B as Browser
T->>C: driver.findElement(By.id(...))
C->>D: HTTP request (W3C WebDriver JSON)
D->>B: Native browser automation command
B-->>D: Result
D-->>C: HTTP response (JSON)
C-->>T: WebElement / value
The driver executable is what actually knows how to talk to that specific browser's native automation hooks - for ChromeDriver, this is built on the Chrome DevTools Protocol internally, translated into and out of the standardized WebDriver JSON format so the same client code works regardless of which browser is on the other end. This driver-executable layer is exactly what Selenium 4's client libraries and Selenium Grid both build on top of.
More Related questions...