Skip to content

Test Automation

Playwright vs Selenium in 2026: How to Choose the Right Tool

JL Jeremy Luong · Author
8 min read
Playwright vs Selenium in 2026: a decision framework (cover image)

“Should we use Playwright or Selenium?” still comes up all the time in test automation. The honest answer is “it depends,” which doesn’t help much on its own. So here’s how I’d make the Playwright vs Selenium call in 2026, based on what your team already knows, which browsers you need, and what the suite will cost to maintain.

The short version is that for a brand-new web project, I’d start with Playwright. Selenium is far from dead, though, and there are good reasons to keep it or even pick it. I’ll go through the evidence first, then the trade-offs.

Playwright vs Selenium: what the data says in 2026

Popularity isn’t a strategy. It does show where tooling, hiring, and community answers are heading, though, so here’s what the public data says.

Momentum favors Playwright

  • In the week of Sept. 28 to Oct. 4, 2026, the playwright npm package had about 131 million downloads. selenium-webdriver had about 2.2 million (npm trends).
  • Over five years, Playwright went from well under 1 million weekly downloads in 2021 to about 131 million today, while selenium-webdriver has eased from a 2022 peak of about 3 million to about 2.2 million (npm download data).
  • Playwright tied for the largest usage gain in State of JS 2025, at +14 points. In the survey’s overall library satisfaction ranking, Selenium sat at about 24%.

There’s a big caveat. npm only counts JavaScript installs, and most of Selenium’s footprint is in Java and Python, which install through Maven and PyPI. Treat these numbers as a sign of direction, not market share.

The job market still wants both

Hiring data is more balanced:

So Playwright is winning new projects, and Selenium still runs a huge installed base. If you work in test automation, it pays to know both.

How they differ under the hood

Most of the practical differences come down to architecture.

Playwright vs Selenium architecture diagram: Playwright controls Chromium, Firefox and WebKit directly through its own protocol, while Selenium goes through the W3C WebDriver standard and browser drivers to Chrome, Firefox, Edge and Safari
Selenium has one extra layer: browser drivers sit between the WebDriver standard and the browser.
PlaywrightSelenium
ProtocolControls browsers directly through its own protocolW3C WebDriver standard, now adding WebDriver BiDi
BrowsersChromium, Firefox, WebKit through one APIChrome, Firefox, Edge, Safari, plus older browsers via drivers
LanguagesJS/TS, Python, Java, .NETJava, Python, C#, JavaScript, Ruby, and more
WaitingAuto-waiting locators and web-first assertionsExplicit waits you write yourself
Parallel runsBuilt-in workers and --shardSelenium Grid or your runner’s parallelism
DebuggingTrace Viewer with DOM snapshots and networkScreenshots, logs, and IDE debugging
MobileDevice emulation (Android support is experimental)Real devices through Appium (WebDriver-based)
AI toolingFirst-party Test Agents (Node runner) and MCP serverCommunity and vendor integrations

Selenium keeps moving too. Recent releases keep expanding WebDriver BiDi, a bidirectional protocol for richer browser control (Selenium 4.51 release notes). Selenium Manager now handles driver setup, which used to be a classic Selenium headache.

On the Playwright side, the Test Agents (planner, generator, healer) ship with the Node.js test runner, and Microsoft maintains a separate Playwright MCP server, plus a newer Playwright CLI for coding agents. If AI-assisted testing is on your roadmap, that matters.

The same test in both tools

Here’s a simple login check in Selenium with Java. Look at the explicit wait:

WebDriver driver = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));

driver.get("https://example.com/login");
driver.findElement(By.id("email")).sendKeys("user@example.com");
driver.findElement(By.id("password")).sendKeys("secret");
driver.findElement(By.cssSelector("button[type=submit]")).click();

WebElement banner = wait.until(
    ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".welcome")));
assertEquals("Welcome back", banner.getText());
driver.quit();

And here’s the same check in Playwright with TypeScript:

import { test, expect } from '@playwright/test';

test('user can log in', async ({ page }) => {
  await page.goto('https://example.com/login');
  await page.getByLabel('Email').fill('user@example.com');
  await page.getByLabel('Password').fill('secret');
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page.getByText('Welcome back')).toBeVisible();
});

There’s nothing wrong with the Selenium version. The Playwright one just shows why teams like it: you don’t write a wait, and the assertion retries on its own. Fewer hand-written waits usually means fewer timing bugs.

When I’d pick Playwright

I’d make Playwright the default when:

  • You’re starting a new web project. Auto-waiting, tracing, and parallel runs come built in, so there’s no extra infrastructure to set up.
  • Your team writes TypeScript or JavaScript. That’s where Playwright’s ecosystem is richest, even though Python, Java, and .NET bindings exist.
  • You need WebKit coverage alongside Chromium and Firefox from one API.
  • You test APIs too. The built-in request fixture lets one runner handle both API and UI checks.
  • You want first-party AI tooling. Test Agents ship with the Node.js test runner, and Microsoft maintains a separate MCP server.

When I’d pick (or keep) Selenium

Selenium is often the right call when:

  • You have a large, stable Selenium suite. If it’s reliable and cheap to maintain, a rewrite rarely pays for itself.
  • Your team lives in Ruby, or has a deep Java ecosystem built on Selenium. Playwright supports Java and .NET too, but Selenium’s language reach is wider, and its Java ecosystem (TestNG, Cucumber, existing grids) is mature.
  • You need real mobile devices. Appium builds on the WebDriver protocol, so the skills carry over.
  • You need specific or older browsers that Playwright’s bundled engines don’t cover.
  • You rely on a vendor grid or tool built around WebDriver.

The hidden cost: maintenance

The license is free either way. What you really pay for is the hours your team spends keeping tests green. I’d compare tools on three questions:

  1. How much waiting code will we write? Every hand-written wait is a future flaky test.
  2. How fast can we debug a CI failure? A trace with DOM snapshots and network calls usually beats a screenshot and a stack trace.
  3. How hard is it to hire for? Both skills are in demand, so start from the language your team already uses.
Three maintenance questions compared: waiting code (Playwright auto-waiting vs Selenium explicit waits), debugging CI failures (Trace Viewer vs screenshots and logs), and hiring (both skills are in demand)
How each tool answers the three maintenance questions.

If you already run Selenium and the pain is real, you can move in phases. Port the most valuable tests first and keep both suites running while they overlap.

Three Playwright vs Selenium myths

A lot of advice on this topic repeats claims that were true years ago. These are the three I’d retire.

Myth 1: “Selenium is too old to be maintained”

Selenium is under active development. The 4.50 and 4.51 releases (September and October 2026) kept expanding WebDriver BiDi support. It’s also built on a W3C standard, which many browser vendors implement directly. Age isn’t the problem. Verbose waits and brittle locators usually are, and you can fix those in any tool.

Myth 2: “Playwright is only for JavaScript teams”

Playwright has official bindings for Python, Java, and .NET as well as TypeScript (Playwright docs). The catch is that the runner with the most features, @playwright/test, is the Node.js one. A Java team gets the browser automation but not every runner feature, and the Test Agents are one of the gaps. Check which features you need before you decide.

Myth 3: “You have to pick one forever”

You don’t. Many teams run both for a while. New tests go into Playwright, and stable Selenium tests stay put until they need real work, so the old suite shrinks over time. You spread the cost and keep your coverage, and it’s far less risky than a big-bang rewrite.

A note on cost of change

If you do decide to move, plan for the real work. Converting syntax is the easy part. The hard part is your page objects, test data, and CI setup. I think the teams that succeed migrate the most valuable tests first and delete low-value tests instead of porting them.

Playwright vs Selenium decision checklist

Answer these before you commit:

  • Is this a new project, or an existing suite that already works?
  • What language does the team write every day?
  • Which browsers and devices do you have to cover, including real mobile devices?
  • Do you need built-in parallelism, or do you already run a grid?
  • How much time does the team spend on flaky tests and waits today?
  • Is AI-assisted test generation part of your plans?
  • Will the people who maintain the suite be easy to hire?

If most answers point to “new, TypeScript, modern browsers,” choose Playwright. If they point to “existing suite, wide device coverage,” Selenium is probably still the better fit.

Decision guide table: new web projects, TypeScript teams, Chromium/Firefox/WebKit coverage and built-in parallelism lean Playwright; existing stable suites, Ruby or other languages Playwright doesn't support, real mobile devices and existing grids lean Selenium
Go row by row; the column with more of your answers is the likely fit.

Keep reading

Once you’ve picked a tool, the next question is which test layer should catch which failure, and that’s where contract testing vs E2E testing comes in.

JL

Written by

Jeremy Luong

SDET Consultant

More about the author

2 comments

Leave a Reply

Your email address will not be published.