Playwright vs Selenium — what is the real difference?
The headline difference is architecture. Selenium speaks the W3C WebDriver protocol, historically an HTTP request per command, which adds latency and is why you lean on explicit waits. Playwright keeps a persistent connection to the browser (CDP for Chromium, dedicated protocols for Firefox and WebKit) and bakes auto-waiting into every action through actionability checks, which removes a whole class of flakiness. Playwright also bundles its own browser builds, ships tracing, codegen and network interception in the box, and parallelism is free. Where Selenium still wins: a far larger ecosystem and Grid maturity, the widest language support, and it drives real installed browsers, which some compliance setups require.
Lead with architecture — Playwright's persistent connection with built-in auto-waiting versus Selenium's per-command WebDriver round-trips — because that one difference explains the flakiness gap everything else follows from. Then be scrupulously fair about where Selenium still wins: the broadest language and grid ecosystem and mature real-device clouds. The senior signal is naming Selenium 4's BiDi protocol, which shows you know the gap has narrowed and you are comparing today's tools, not a stale caricature.
How to phrase it
The real difference is architectural, not cosmetic. Selenium speaks the W3C WebDriver protocol, which historically meant an HTTP request per command, and that latency plus the lack of built-in waiting is why Selenium suites lean so heavily on explicit waits. Playwright keeps a persistent connection to the browser and bakes auto-waiting into every action. That single design choice removes a whole category of flakiness you fight constantly in Selenium. Playwright also bundles its own browser builds, ships tracing, codegen and network interception, and gives you parallelism for free. But I am careful to be fair, because pretending Selenium is obsolete is a junior tell. Selenium still wins on ecosystem and Grid maturity, on the widest language support, and it drives the real installed browser, which some compliance environments require. And Selenium 4 added BiDi and relative locators, so the gap is narrower than people assume. My honest landing is that for greenfield JavaScript or TypeScript web testing, Playwright is the default, but Selenium remains the right call for a polyglot org with a mature Grid investment.
Key points to hit
- Selenium: W3C WebDriver, historically HTTP-per-command — hence heavy explicit waits.
- Playwright: persistent connection plus built-in auto-waiting removes a class of flakiness.
- Playwright bundles browsers and ships tracing, codegen and interception; parallelism is free.
- Selenium still wins: ecosystem, Grid maturity, widest language support, real installed browsers.
- Selenium 4's BiDi narrows the gap, but Playwright is the greenfield JS or TS default.
// Playwright: auto-waits for the element to be actionable
await page.getByRole("button", { name: "Submit" }).click();
// Selenium (Java) equivalent: the explicit wait is on you
// new WebDriverWait(driver, Duration.ofSeconds(10))
// .until(ExpectedConditions.elementToBeClickable(
// By.cssSelector("button[type=submit]"))).click();