Selenium · Browser automation foundations
How does Selenium WebDriver work end to end?
Short answer
Language bindings turn commands into W3C WebDriver HTTP requests. A browser-specific driver such as chromedriver receives each request, controls the browser, and returns a JSON response with the result.
There are four layers to reason about: your test code, the language binding, the browser driver, and the browser itself. The binding serialises commands, the driver translates them into browser actions, and the response travels back the same way. No test code runs inside the browser process unless you explicitly execute JavaScript.
- Your test runs in a JVM, Python interpreter or Node process
- The binding exposes methods such as findElement and click over HTTP
- The driver owns the browser process and the protocol session
- The browser renders the page and exposes DOM and navigation behaviour
import java.net.URL;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
WebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"),
new ChromeOptions());
driver.get("https://example.com");
driver.quit();When you call new ChromeDriver(), the binding starts chromedriver and creates a session. ChromeDriver then launches Chrome and holds the connection. Selenium Manager can locate or download chromedriver, which removes most manual driver setup but does not remove the driver process itself.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What runs inside the browser process?
- 2What is the role of chromedriver?
- 3What happens when the browser crashes mid-test?
- 4How does Selenium Manager fit into session creation?
Say it in the interview
My test code uses a language binding, which sends W3C WebDriver commands over HTTP to a browser driver such as chromedriver. The driver launches and controls the browser and returns JSON responses. That separation is why I can swap local Chrome for a remote Grid node without changing test logic. The driver is a separate process, so a browser crash invalidates the session and needs explicit cleanup.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Selenium mock interview and get scored feedback on depth, clarity and confidence.