Selenium to Playwright: a migration that survives sprints
A flaky Selenium suite slows every release and erodes trust in your tests. Moving to Playwright can fix that, if you migrate in a way that survives sprints. Here is the playbook we use.
By Quality AboveAll · May 8, 2026 · 8 min read
Do not rewrite everything at once. Run Selenium and Playwright side by side, migrate your highest-value flows first, and cut over in CI only when the new suite is greener and faster. We do this as framework modernization.
Why teams move off Selenium
Selenium is proven and everywhere. But older suites often suffer from brittle waits, slow runs, and constant maintenance. Playwright was built later, with auto-waiting, parallelism, and a trace viewer that makes failures easy to diagnose.
The result is usually fewer flaky tests, faster runs, and less time spent babysitting the suite. But a bad migration trades one mess for another. Sequence it.
The migration playbook
1. Audit what you have
Map your existing tests by value and flakiness. The flakiest, highest-traffic flows go first. The dead tests get deleted, not ported.
2. Stand Playwright up alongside Selenium
Add Playwright in TypeScript or Python without removing Selenium. Both run in CI. Nothing breaks while you migrate.
3. Migrate by value, not by file
Port the critical paths first: login, checkout, the flows that cost you most if they break. Each migrated flow earns its keep immediately.
4. Gate it in CI
Wire the new suite into your pipeline so it blocks merges on failure. This is the same CI/CD test integration discipline we bring to every engagement. Add visual snapshots for UI safety, which pairs with our visual regression in CI.
5. Cut over when the numbers say so
Retire the Selenium flow only when its Playwright replacement is greener and faster. Measure, then cut. No guesswork.
What good looks like
- Flaky-test rate down, run time down, both measured.
- Every critical path covered before any old test is deleted.
- A suite your developers can read and extend, in a language they already use.
That is the work behind our framework modernization service: an audit, an incremental port, and a clean CI cutover. If your suite is fighting you, a testing audit is the fastest way to a plan.
Senior-led QA,embedded in your workflow.
Often less than one full-time hire. Book a free 30-minute testing audit and we'll show you exactly where the risk is hiding.