Selenium to Playwright: The Migration Playbook We Wish Existed

A developer moving to a new dual-monitor workstation, illustrating a Selenium to Playwright migration
In this post
  1. TL;DR
  2. When Migration Is Worth It (And When It Isn't)
  3. The Two Approaches: Shim vs Rewrite
  4. Three Hidden Costs Nobody Warns You About
  5. A 4-Week Selenium to Playwright Migration Timeline That Works
  6. What To Not Migrate (The Tests Worth Deleting Instead)
  7. Where Nopmark Fits
  8. FAQ

A Selenium to Playwright migration is the testing theme of 2026. TestGuild's survey of 40,000+ testers puts the shift at the top of the trend list, and Reddit's testing communities are openly recommending teams not start new Selenium projects in 2026. The question is no longer whether to migrate. The question is how to migrate without spending a full quarter on it.

This is the playbook. It covers when migration is worth it, when it isn't, the two approaches that work, the three hidden costs that derail teams, and a 4-week timeline you can adapt.

TL;DR

  • Migrate when your Selenium suite is a maintenance drain or you are starting new test surfaces in 2026.
  • Do not migrate yet if your suite is small, stable, and not blocking releases.
  • Two approaches: a compatibility shim (faster, partial gains) or a rewrite (slower, full gains).
  • Three hidden costs: test data fixtures, CI runner differences, team retraining.
  • A 4-week migration is realistic for a suite of 200-500 tests with the rewrite approach.
  • Delete more tests than you migrate. Your old Selenium suite has dead weight you have been paying for.

When Migration Is Worth It (And When It Isn't)

The honest framework first.

Migrate now if any of these are true:

  • Driver-version maintenance is consuming more than two engineer-hours per week.
  • You are starting a new product surface or major feature area in the next 90 days.
  • Your team is hiring and the hires expect Playwright (this is increasingly common for new SDETs).
  • Your auto-wait logic has produced more than three production incidents in the last year.
  • You are planning to add AI-generated tests and want a framework with first-class support for it.

Do not migrate yet if all of these are true:

  • Your Selenium suite is under 100 tests and stable.
  • You have no upcoming product surface changes.
  • Your team has deep Selenium expertise and no Playwright skills.
  • Your CI is reliable and your flake rate is under 2%.

The trap to avoid is migrating for fashion. Playwright is better for most teams in 2026, but "better" is not the same as "worth a quarter of your team's time right now." If your Selenium suite is paying for itself, leave it alone and migrate the next net-new test surface to Playwright instead.

The Two Approaches: Shim vs Rewrite

There are two real approaches. There are also three fake ones (we will name them).

Approach 1: The compatibility shim

You wrap your Selenium WebDriver calls in a thin layer that, behind the scenes, dispatches to Playwright. Your existing test code keeps running. New tests can be written in either framework. You migrate incrementally.

Pros:

  • Fast to start. You can have hybrid execution running in a week.
  • Old tests keep working without rewrites.
  • Low risk of regression.

Cons:

  • You do not get most of Playwright's wins (auto-wait, trace viewer, parallel context isolation) because the shim translates calls 1:1.
  • You now maintain two frameworks plus the shim layer.
  • Eventually you have to rewrite the tests anyway to capture the real benefits.

Use when: your suite is large (500+ tests), the team is risk-averse, and you need to keep shipping while migrating.

Approach 2: The full rewrite

You write a new Playwright suite from scratch, mirroring critical paths. Old Selenium tests run in parallel during the transition. When Playwright coverage is sufficient, you turn the Selenium suite off.

Pros:

  • You get all of Playwright's benefits from day one.
  • You delete tests during migration. This is a feature, not a bug, because your old suite has dead weight.
  • One framework to maintain at the end.

Cons:

  • Slower to start. First two weeks are mostly setup and scaffolding.
  • Higher upfront risk if you do not have Playwright expertise on the team.
  • Requires discipline to maintain test parity through the transition.

Use when: your suite is under 500 tests, the team can absorb a 4-6 week investment, and you want the full benefit, not a halfway state.

The fake approaches

For honesty:

  • "We will write all new tests in Playwright and let the old Selenium tests die naturally." This works for about 4 months, then you have two frameworks forever because Selenium tests never actually die. Avoid.
  • "We will hire a consultant to migrate it for us." Consultants migrate the code. They do not migrate the team's understanding. You end up with a Playwright suite nobody can maintain.
  • "We will let AI migrate it." AI is useful for the mechanical parts of migration (locator translation, syntax conversion). It cannot make the judgment calls about which tests to delete, which to redesign, and which to skip. It can help. It cannot lead.

Three Hidden Costs Nobody Warns You About

These are the costs that derail migrations after the kickoff energy fades.

Hidden cost 1: Test data fixtures

Your Selenium tests almost certainly have a test data layer. Fixture builders, factory methods, database seeders, mock API responses. Most of this code is framework-agnostic in theory and framework-coupled in practice.

When you migrate, you discover that your fixtures depend on Selenium-specific timing assumptions, or on a custom retry helper that wraps Selenium's wait logic. Untangling this is the longest part of most migrations. Budget at least 30% of total migration time for fixture refactoring.

The mitigation: refactor fixtures first, before you touch the test code. Make the fixture layer framework-agnostic. Then migrating the test code is straightforward.

Hidden cost 2: CI runner differences

Selenium and Playwright have different CI footprints. Playwright tends to be faster per-test but heavier per-runner because it spins up browser contexts. Your existing CI parallelization strategy may not translate.

Specifically: if you are running 8 parallel Selenium jobs on small runners, you may need 4 parallel Playwright jobs on medium runners. Total wall-clock time can stay the same or improve, but your runner costs and your CI configuration both change.

The mitigation: prototype the CI configuration on a single critical-path test before you commit to the full migration. Measure runner cost and wall-clock time on real CI. Adjust your migration plan based on what you measure, not what the docs promise.

Hidden cost 3: Team retraining

Every QA engineer on your team has muscle memory for Selenium. Every habit, every debugging instinct, every "I know exactly where to look" reflex is built on Selenium's behavior model.

Playwright's behavior model is different enough that the first two weeks of using it feel slower, not faster. Engineers will ask whether the migration was worth it. The answer becomes "yes" around week 3, but you have to get to week 3.

The mitigation: pair the most senior engineer with the most junior on the first migration sprint. Both will learn faster than either would alone, and the team builds shared muscle memory rather than depending on one person's expertise.

A 4-Week Selenium to Playwright Migration Timeline That Works

This timeline is for a suite of 200-500 tests using the rewrite approach. Adjust proportionally for larger suites.

Week 1: Foundation

  • Refactor fixtures to be framework-agnostic.
  • Set up Playwright in CI with one critical-path test running end-to-end.
  • Measure baseline: runner cost, wall-clock time, flake rate of the Selenium suite.
  • Decide on the page object model pattern your team will use (Playwright's recommended pattern, or your existing pattern adapted).

Week 2: Critical paths

  • Migrate the 10-20 highest-business-value tests (login, checkout, primary user journeys).
  • Run them in parallel with the Selenium versions for one full week to verify behavioral parity.
  • Document the patterns the team is using. This becomes the migration handbook for everyone else.

Week 3: Bulk migration

  • Migrate the next 60-70% of the suite using the patterns established in Week 2.
  • Delete tests that are not earning their keep (you will find them, because every Selenium suite has 10-20% dead tests).
  • Keep the Selenium suite running in parallel.

Week 4: Cutover and cleanup

  • Migrate the remaining edge-case tests.
  • Run both suites in parallel for one final week.
  • Compare results, investigate any divergences.
  • Turn off the Selenium suite.
  • Decommission the Selenium-specific CI configuration.

If your suite is 200-300 tests and you stay disciplined about deletion, four weeks is realistic. If you keep all your tests, double the timeline. If you have more than 500 tests, plan in 4-week chunks.

What To Not Migrate (The Tests Worth Deleting Instead)

The most underrated outcome of a Selenium-to-Playwright migration is the number of tests you discover were not worth migrating in the first place.

Delete during migration if a test:

  • Has not failed in 12 months and exercises a code path that has not changed.
  • Tests behavior that is also covered by a unit test or integration test (duplicate coverage).
  • Tests behavior the business no longer cares about (deprecated features).
  • Requires more than 30 lines of setup to test 3 lines of behavior.
  • Has been disabled or skipped for more than 3 months.

A healthy migration deletes 15-25% of the original suite. If you are deleting less than 10%, you are migrating dead weight.

Where Nopmark Fits

If your team is the one doing the migration, Nopmark's certification programs cover the test design fundamentals (ISTQB CTFL) and team-level skills assessment (TestAscend) that make migration projects succeed instead of stall.

The technical migration is the easy part. The hard part is the team-level discipline: deciding what to delete, agreeing on patterns, building shared muscle memory in a new framework. Strong fundamentals make those decisions faster.

FAQ

How long does a Selenium-to-Playwright migration actually take? Four weeks is realistic for 200-500 tests with the rewrite approach, assuming you delete 15-25% of the suite and have one engineer with prior Playwright experience. Double the timeline for the shim approach because you have to do it twice.

Should I migrate everything, or only some tests? Migrate the critical paths and the test surfaces that are actively changing. Leave stable, low-maintenance test surfaces alone. Delete anything that has not earned its keep.

Will my CI bill go up or down? Probably stay roughly the same, but the shape changes. Playwright runs faster per-test but uses heavier runners. Prototype on real CI before committing.

Can I use AI to migrate the tests for me? AI is useful for the mechanical work (locator translation, syntax conversion). It cannot make the strategic calls about what to delete or what to redesign. Use it as a tool, not a lead.

What's the biggest mistake teams make? Migrating for completeness instead of for value. The point is not to end up with a Playwright copy of your Selenium suite. The point is to end up with a smaller, faster, more maintainable test suite that happens to be in Playwright.

Does this apply to Cypress migrations too? The strategic framework yes, the specifics no. Cypress and Playwright have different CI footprints and different page-object idioms. A separate playbook is coming for Cypress.

Ready to migrate a Selenium suite without losing a quarter to it?

Keep reading