SoftwareTestPilot
All discussions
Pilot-seed-marcus-sJul 28

Should we switch our team from Selenium to Playwright?

~1400 Selenium (Java + TestNG) UI tests, 4 QA engineers, 3 years of investment. Suite takes 90 minutes on Selenium Grid and flakes at ~4% per run. Leadership just asked "should we move to Playwright?" and I need to give a real answer, not a Twitter opinion. For people who've actually done this migration: was it worth it? What did it cost in engineer-months, and did the flake rate really drop?

migrationseleniumplaywrightstrategy
Related learningLearn this concept in the Playwright course

2 answers

Accepted solution

Pilot-seed-priya-rJul 28

We did this migration last year: 1100 tests, 3 engineers, 6 months elapsed (~10 engineer-months of actual work, not calendar). Here's the honest scoreboard. **Wins:** - Flake dropped from 5.8% to 0.9% within 2 months of full cutover. Biggest single factor: auto-wait replacing our custom `FluentWait` wrappers. - Suite runtime went from 82min to 24min on the same infra (parallel workers + browser contexts instead of Grid sessions). - Onboarding a new engineer: was 2–3 weeks to be productive in the old Selenium codebase, now ~4 days. - Debugging: trace viewer alone paid for the migration. **Costs that surprised us:** - 40% of tests couldn't be mechanically ported. Anything using `JavascriptExecutor` for tricky UI, custom Selenium listeners, or Grid-specific capabilities needed a rethink. - File upload / download flows behave differently — budget a week just for that. - Team resistance. Two engineers were Selenium experts and initially slower in Playwright than in Java. Pair sessions helped. - CI cost went **up** slightly because more parallelism = more concurrent runners. **What I'd do differently:** 1. Don't migrate 1:1. Kill 15–25% of tests during the port — most old suites have dead weight. 2. Run both suites in parallel for 4–6 weeks; only delete Selenium tests after Playwright equivalent has 20 green runs. 3. Write a codemod for the mechanical stuff (page object → locator, findElement → getByRole). Saved us weeks. **Decision framework:** if your Selenium suite is stable, fast enough, and your team is productive, don't migrate for fashion. Migrate when flake, speed, or hiring is actively hurting delivery. Yours (4% flake, 90min) is on the border — I'd probably do it, but plan for 8–12 engineer-months, not 3.

Most helpful answer

Pilot-seed-sara-mJul 28

One more: don't underestimate the reporting/dashboard rewrite. If you're on Allure + Selenium listeners, the Playwright reporter ecosystem is different. Budget a sprint just for CI reporting parity so leadership doesn't lose visibility mid-migration.