Testing & QA

Selenium vs Cypress vs Playwright: Choosing a Test Automation Tool

Three strong browser automation tools with different designs. Here is how Selenium, Cypress and Playwright compare and which one fits your team and product.

  • DivTech editorial team
  • 8 min read
Selenium
vs
Cypress
vs
Playwright
Testing & QA · part 3 of 5

Choosing a browser automation tool is a decision a team lives with for years. Selenium, Cypress and Playwright can all automate a modern web application well, but they are built differently, and those differences show up in day-to-day work: which languages your testers can use, how easy a failure is to debug, and how much effort it takes to run tests in parallel.

This comparison focuses on practical criteria rather than on which tool is fashionable. It reflects how our software testing and QA engineers choose tools for client projects. If you are still deciding what to automate at all, start with manual vs automation testing.

How each tool works

Selenium is the veteran. It drives real browsers through the W3C WebDriver standard, using a driver for each browser. It provides libraries rather than a full framework, so you pair it with a test runner such as JUnit, TestNG, pytest or NUnit. Selenium Grid runs tests across many machines and browsers, and Appium extends the same WebDriver approach to mobile apps.

Cypress runs your tests inside the browser, alongside the application. That design gives it direct access to the page, automatic retrying of commands and assertions, and an interactive runner where you can step back through each command and see a snapshot of the page. The trade-offs are that tests are written in JavaScript or TypeScript only, a single test cannot drive multiple tabs, and visiting several domains in one test needs the cy.origin command.

Playwright, created by Microsoft, controls browsers from outside and supports Chromium, Firefox and WebKit, the engine behind Safari. Isolated browser contexts make it fast to give each test a clean session. It waits automatically for elements to be actionable, ships its own test runner with parallel workers for JavaScript and TypeScript, and offers bindings for Python, Java and .NET as well.

Side-by-side comparison

SeleniumCypressPlaywright
LanguagesJava, Python, C#, JavaScript, Ruby and moreJavaScript and TypeScriptJavaScript, TypeScript, Python, Java, .NET
BrowsersChrome, Edge, Firefox, SafariChrome-family browsers and Firefox; WebKit experimentalChromium, Firefox, WebKit
Test runnerBring your ownBuilt inBuilt in for JS/TS; standard runners in other languages
WaitingExplicit waits written by youAutomatic retrying of commands and assertionsAutomatic actionability checks and retrying assertions
Parallel runsThrough the test runner and Selenium GridThrough the vendor's cloud service or third-party orchestrationBuilt-in workers and sharding
DebuggingLogs and screenshots; depends on your frameworkInteractive runner with time-travel snapshotsTrace viewer, UI mode, code generator
Multiple tabs and domainsSupportedOne tab per test; cy.origin for other domainsSupported, including multiple contexts
MobileNative and mobile web through AppiumViewport emulation onlyDevice emulation; Android support experimental

Feature lists change with every release, so confirm anything critical to you against each project's current documentation before deciding.

comparisonStrengths and trade-offs at a glance
SeleniumWidest reach
  • Most language options
  • Real Safari through safaridriver
  • Mobile through Appium
  • More setup and framework work
  • Waits must be handled carefully
CypressFront-end friendly
  • Excellent interactive debugging
  • Strong component testing
  • Quick to start for JS teams
  • JavaScript and TypeScript only
  • Single tab per test
PlaywrightModern all-rounder
  • Three browser engines
  • Built-in parallelism and tracing
  • Several languages
  • WebKit is not identical to Safari
  • No native mobile app testing

verdictFor a new web project, Playwright is often the default; Selenium fits polyglot or legacy estates; Cypress suits JavaScript teams who value its debugging experience.

DivTech System

Speed, flakiness and debugging

Teams often choose a tool because it is said to be faster or less flaky. In practice, test design matters more than the tool. Slow suites are usually slow because they log in through the UI in every test, create data through screens instead of APIs, or run one after another. Flaky suites usually rely on fixed sleeps, shared data or fragile selectors. Any of the three tools can be fast and stable when tests are well designed, and any can be slow and flaky when they are not.

That said, built-in automatic waiting in Cypress and Playwright removes a whole class of timing problems that Selenium users must handle with explicit waits. Debugging tools matter too: when a test fails only in CI, a Playwright trace or a Cypress recording showing exactly what the page looked like can save hours compared with reading logs.

Which tool fits which situation

checklistChoosing by situation
Choose Selenium when
  • Your testers work in Java, C# or Python and want to keep a Selenium-based framework
  • You already have a large, working Selenium suite
  • You need real Safari or native mobile through Appium
  • You run your own Grid or a device cloud built around WebDriver
Choose Cypress when
  • Your team is JavaScript or TypeScript first
  • Developers will write most tests and value interactive debugging
  • You want component tests and end-to-end tests in one tool
  • Your flows stay in one tab and mostly one domain
Choose Playwright when
  • You are starting a new web automation suite
  • You need Chromium, Firefox and WebKit coverage
  • You want built-in parallel runs without extra services
  • Your flows involve multiple tabs, users or domains
DivTech System

Language often settles the question. A team building in Java or .NET with QA engineers who already write those languages will be productive with Selenium or Playwright's bindings for those languages. A product team building a React front end, where developers write many of the tests, may prefer Cypress or Playwright in TypeScript. Framework choice on the front end matters less than you might think; our comparison of React vs Angular covers that separately.

Total cost of ownership

All three tools are open source, so the licence is rarely the deciding cost. The real costs sit elsewhere, and they add up over the years a suite is in use:

  • Infrastructure: browsers and CI runners to execute tests in parallel, or a commercial browser or device cloud. Selenium Grid needs hosting and upkeep if you run it yourself.
  • Optional services: Cypress parallelisation and dashboards are typically delivered through its commercial cloud service or third-party tools; Playwright and Selenium rely on your CI or test runner for the same.
  • Framework effort: Selenium needs more upfront work on waits, reporting and structure, while Cypress and Playwright provide more out of the box.
  • Skills and hiring: the tool your team, or the people you can hire, already know well usually beats a theoretically better one nobody has used.
  • Maintenance: the largest long-term cost in any tool, driven by locator strategy, test data and how often the UI changes.

Mobile apps are a separate decision

None of the three tools tests native iOS or Android apps directly. Device emulation in Playwright and viewport settings in Cypress only simulate screen sizes in a desktop browser. For native apps built by our mobile app development teams, the usual options are Appium, or the platform tools XCUITest for iOS and Espresso for Android, run on real devices or a device cloud.

Run a short pilot before you commit

processA two-week tool pilot
  1. 01Pick flows

    Choose five to ten critical journeys, including at least one awkward one such as file upload, payments or multiple users.

  2. 02Build in each candidate

    Have the people who will maintain the suite write the same tests in each shortlisted tool.

  3. 03Run in CI

    Run every test many times in your real pipeline and environments, not only on a laptop.

  4. 04Measure

    Compare authoring time, run time, failure rate, quality of failure reports and ease of debugging.

  5. 05Decide and document

    Choose, then write down conventions for locators, test data and structure before scaling up.

Indicative duration; a single-tool proof of concept can be shorter.

DivTech System

Switching tools without a big-bang rewrite

If you already have a working Selenium or Cypress suite, there is rarely a reason to rewrite it all at once. Write new tests in the new tool, port the most valuable and most flaky old tests first, and retire the rest as the features they cover change. Run both suites in the CI/CD pipeline during the transition, and set a date for removing the old one so you do not maintain two frameworks forever. The process side of this, from definition of done to test gates, is covered in our guide to a QA process for agile teams.

DivTech's QA engineers work with all three tools and can run a pilot on your own application or take over an existing suite. Contact us to discuss which fits your team.

Frequently asked questions

Is Playwright better than Selenium?

Not universally. Playwright offers built-in waiting, parallelism and tracing that make new suites quicker to build. Selenium supports more languages, real Safari and native mobile through Appium, and many teams have mature Selenium frameworks that work well.

Can Cypress test Safari?

Cypress supports Chrome-family browsers and Firefox, with WebKit support marked experimental. If real Safari coverage is essential, Selenium with safaridriver or a device cloud is the more direct route; Playwright's WebKit is close to Safari but not identical.

Which tool is best for testing mobile apps?

For native iOS and Android apps, use Appium or the platform tools XCUITest and Espresso. Selenium, Cypress and Playwright are browser tools; they can emulate mobile screen sizes but cannot drive native apps.

Should we migrate our Selenium suite to Playwright?

Only if the current suite has real problems such as slowness, flakiness or high maintenance that a pilot shows Playwright would solve. If you migrate, do it gradually: new tests in Playwright, valuable old tests ported first.

  • Test automation
  • Selenium
  • Cypress
  • Playwright

free consultation

Need help with testing & qa?

Talk to our Software Testing & QA team. We'll review your situation and suggest a practical next step, free.