· playwright / puppeteer / browser-automation

Playwright vs Puppeteer — Chrome automation in 2026

Playwright wins for new E2E suites; Puppeteer wins for lightweight Chrome scripts. Performance benchmarks, migration costs, and the feature gap explained.

By Ethan

1,524 words · 8 min read

For new E2E test suites, pick Playwright. For short, single-purpose Chrome scripts, Puppeteer still earns its keep. The gap between them has widened every year since 2021, and the download numbers make the argument plainly: Playwright pulls 53.5M weekly npm downloads against Puppeteer’s 9.6M. That’s not a close race.

Who this is for

Engineers choosing a browser automation library for a greenfield project, or maintaining a Puppeteer suite and wondering whether migration is worth the effort. If you’re already on Playwright and it’s working, nothing here changes your calculus.

What we tested

Playwright 1.60 against Puppeteer 25.0.2, both current as of May 2026. Performance data comes from Skyvern’s 2025 browser automation benchmark — wall-clock execution across four scenario types on hardware Skyvern does not disclose. Feature observations come from both libraries’ current documentation and GitHub commit history. Download data from npmtrends.com (May 2026 weekly averages).

Findings

Quick verdict

Playwright for most E2E testing; Puppeteer for lightweight Chrome scripting. Playwright ships a test runner, trace viewer, cross-browser support, and auto-waiting locators in one package. Puppeteer is smaller, starts faster, and gives you more direct Chrome DevTools Protocol access — advantages that matter mainly for scripts, not test suites.

Feature comparison

FeaturePlaywright 1.60Puppeteer 25.0.2
Browser supportChromium, Firefox, WebKitChrome/Chromium (+ Firefox via BiDi, experimental)
Language supportJS, TypeScript, Python, Java, .NETJS, TypeScript
Built-in test runnerYes — @playwright/testNo — needs Jest or Mocha
Auto-waitingLocator-based retries, web-first assertionsBasic; timing-sensitive
Trace viewerFull timeline, DOM snapshots, networkNone
Parallel executionWorker-based, built-inDelegated to external runner
Network interceptionpage.route() with conditional logicEvent-listener model
Cross-browserTrue multi-browserChrome-only in practice
Mobile emulationNative Chrome Android + Mobile SafariViewport scaling only
TypeScriptDefault on initSupported, not default
HAR recordingFirst-class tracing API (v1.60)None
Accessibility snapshotsARIA snapshots with bounding boxesNone
Screenshots/video on failBuilt-inManual via page.screenshot()
Weekly npm downloads~53.5M~9.6M
GitHub stars~88,845~94,300

Puppeteer’s star count is still higher — it had a multi-year head start. The download gap is the more relevant signal: usage diverged sharply after Playwright’s weekly downloads overtook Puppeteer’s in 2023 and kept accelerating.

Playwright is also the top alternative to Cypress at this tier — if Cypress is on your shortlist, Playwright vs Cypress 2026 runs the same comparison with Cypress-specific trade-offs around component testing and time-travel debugging.

Code: the same login test in both tools

Same scenario, same assertions. This is the clearest way to see where the APIs diverge.

Puppeteer

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  const page = await browser.newPage();
  await page.goto('https://example.com/login');

  await page.type('#email', '[email protected]');
  await page.type('#password', 'secret');
  await page.click('button[type="submit"]');

  await page.waitForNavigation({ waitUntil: 'networkidle2' });
  const url = page.url();
  console.assert(url.includes('/dashboard'));

  await browser.close();
})();

Playwright (@playwright/test)

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

test('login redirects to dashboard', async ({ page }) => {
  await page.goto('https://example.com/login');

  await page.getByLabel('Email').fill('[email protected]');
  await page.getByLabel('Password').fill('secret');
  await page.getByRole('button', { name: 'Sign in' }).click();

  await expect(page).toHaveURL(/\/dashboard/);
});

Three differences that actually matter:

  • Selector strategy: Puppeteer’s #email and button[type="submit"] selectors break when the DOM changes. Playwright’s getByLabel and getByRole are tied to the accessibility tree — they survive markup refactors without test rewrites.
  • Auto-waiting: expect(page).toHaveURL() retries until the assertion passes or times out. No manual waitForNavigation call. That’s the difference between a test that’s brittle at 2s and one that handles slow 4G throttling without flaking.
  • Structure: The Puppeteer snippet is a standalone IIFE — a script. The Playwright snippet is a proper test with error reporting, isolation, and parallelism built in.

Performance data

Skyvern’s 2025 benchmark measured wall-clock execution for four scenario types (hardware undisclosed):

ScenarioPuppeteerPlaywrightFaster
Short single-page scripts~3.2s~4.5sPuppeteer (~30%)
Navigation-heavy flows4.784s4.513sPlaywright
Full E2E scenarios~8.2s~8.1sTie
Scraping tasks~6.7s~7.2sPuppeteer

Puppeteer’s ~30% speed advantage for short scripts is real. It’s also narrow: it disappears as soon as network latency and page load time dominate the runtime. In a 50-test CI suite, Playwright’s built-in parallelism — multiple browser contexts sharing one browser process — typically delivers better total wall-clock time than Puppeteer coordinated through Jest workers.

The table also leaves out a hidden cost: flaky test retries. Tests that fail intermittently on waitForTimeout in Puppeteer often run consistently in Playwright because auto-waiting is built into every assertion. Retry overhead compounds across hundreds of CI runs; one flaky test retrying twice per run adds up fast.

Run your Playwright test suite on real browsers in the cloud: Try BrowserStack free for 30 days.

Migration cost: Puppeteer → Playwright

Most Puppeteer patterns translate directly. This is an API translation, not a rewrite:

PuppeteerPlaywright
require('puppeteer')import { chromium } from 'playwright'
browser.newPage()context.newPage() (context-first model)
page.type('#email', val)page.getByLabel('Email').fill(val)
page.waitForNavigation({ waitUntil: 'networkidle2' })await expect(page).toHaveURL(...)
page.waitForTimeout(2000)await expect(locator).toBeVisible()
page.on('request', handler)await page.route('**/api/*', handler)
page.screenshot()page.screenshot() (identical)

Effort estimate from community consensus:

  • Small suite (<50 tests, actively maintained): 1–2 weeks. The payoff — trace viewer debugging and cross-browser coverage — arrives immediately after the switch.
  • Large stable suite (500+ green tests): Not an emergency. Puppeteer still ships security updates. Migration earns out if cross-browser coverage or flaky-test diagnosis are active pain points; otherwise the payback period is long.

The main friction points are the context model shift (Playwright’s browser → context → page hierarchy vs. Puppeteer’s page-centric API) and selector rewrites. Selectors take the most time but produce the most resilient output — getByLabel and getByRole selectors are substantially harder to break than CSS selectors. Node.js 20+ is required for Playwright 1.60; check your system requirements before starting.

Already on Puppeteer and want cloud infrastructure without switching tools? Run your Puppeteer tests on LambdaTest.

For the unit-testing layer that runs alongside your E2E suite, Vitest vs Jest 2026 covers the same decision for component and unit tests.

When to pick each

Pick Playwright when

  • Building a new E2E test suite — it’s the default choice in 2026
  • You need cross-browser coverage (Firefox, Safari via WebKit)
  • Your team works in Python, Java, or .NET alongside JavaScript
  • You want trace-first debugging in CI — the built-in trace viewer cuts flaky-test investigations from hours to minutes
  • You need parallel test isolation without wiring up an external test runner
  • You’re testing mobile viewport behavior with actual Chrome Android or Mobile Safari emulation

Pick Puppeteer when

  • Writing single-purpose Chrome scripts — screenshots, PDFs, form automation, scraping
  • The script is short and throwaway — the ~30% startup advantage compounds when you run thousands of one-off jobs
  • You need direct Chrome DevTools Protocol access — Puppeteer’s CDP integration is more granular than Playwright’s abstractions
  • You have a large, stable, green Puppeteer test suite — migration cost exceeds value unless cross-browser coverage or trace debugging are blocking pain points
  • You’re running a high-volume PDF or screenshot pipeline where per-operation overhead scales with volume

Playwright vs Puppeteer: verdict

Use Playwright for test suites. Use Puppeteer for scripts.

The original Puppeteer team left Google in 2019 to build Playwright at Microsoft, carrying the lessons from Puppeteer’s limitations with them. The result is a library that ships what Puppeteer requires you to assemble yourself: a test runner, parallel workers, a trace viewer, and cross-browser support in one cohesive package. The 5.6× download gap is the market’s verdict on that difference.

Puppeteer isn’t finished — it ships security updates, it starts faster for lightweight Chrome scripting, and a stable 500-test suite that’s green and unblocked doesn’t need to migrate on a schedule. For any new work starting in 2026, Playwright is the right default.

Caveats

Performance numbers are from Skyvern’s 2025 benchmark; your workload may differ based on test complexity, network conditions, and hardware. Download counts are npmtrends weekly averages as of May 2026. GitHub star counts are point-in-time snapshots.

BrowserStack and LambdaTest are affiliate partners. The feature comparison and benchmarks above were based on independent published data; affiliate status did not affect which tool won which row.

References

  1. Playwright docs — Introduction
  2. Playwright release notes — v1.60
  3. Puppeteer documentation — pptr.dev
  4. github.com/microsoft/playwright
  5. github.com/puppeteer/puppeteer
  6. npmtrends.com — playwright vs puppeteer
  7. Skyvern — Puppeteer vs Playwright Complete Performance Comparison (2025)
  8. BrowserStack — Playwright vs Puppeteer 2026
  9. Autonoma — Why Playwright Has Already Won (2026)
  10. Leapcell — From Puppeteer to Playwright: Migration Guide