Skip to content

QA and Testing8 min read

Playwright vs Selenium vs Cypress: Which Should You Use?

Playwright vs Selenium vs Cypress: all three automate browsers well, but they suit different teams. This comparison covers architecture, features, trade-offs and migration.

By NUMVOX team · Published

Short answer: Choose Playwright for new web test suites that need fast, reliable cross-browser runs and strong debugging. Choose Selenium when you have an existing suite, need the widest language and browser support, or run tests on a large grid. Choose Cypress when a JavaScript front-end team wants tests close to the code with an interactive runner.

Playwright vs Selenium vs Cypress: the short answer

All three are mature, open-source tools for automating web browsers, and teams ship reliable suites with each of them. The right choice depends less on which is technically best and more on your team's languages, your existing tests, the browsers you must support and how you run tests in your pipeline.

If you are starting from scratch with no strong constraints, Playwright is a sensible default today. If you already have a working Selenium suite, improving it is often better than replacing it. If your front-end developers write the tests in JavaScript or TypeScript and value the interactive runner, Cypress is a strong fit.

How each tool works

Selenium WebDriver sends commands to a browser driver, such as ChromeDriver or GeckoDriver, using the W3C WebDriver protocol. Each browser vendor maintains its driver, which is why Selenium supports so many browsers. Selenium Manager, included in recent versions, downloads the right driver automatically. Selenium Grid distributes tests across machines.

Playwright communicates with browsers over a persistent connection using their debugging protocols, and ships with its own builds of Chromium, Firefox and WebKit. This gives it fine control over network traffic, multiple browser contexts and events, and lets it wait for elements automatically before acting.

Cypress runs inside the browser alongside the application, with a Node.js process handling tasks outside the browser. This gives direct access to the application and a very fast feedback loop, but it also brings constraints such as no support for controlling multiple browser tabs.

Feature comparison

Playwright, Selenium and Cypress compared
FeaturePlaywrightSeleniumCypress
LanguagesJavaScript, TypeScript, Python, Java, .NETJava, Python, C#, Ruby, JavaScript and moreJavaScript, TypeScript
BrowsersChromium, Firefox, WebKitChrome, Firefox, Edge, Safari and others via driversChrome-family browsers, Firefox, Electron; WebKit experimental
Auto-waitingBuilt in for actions and assertionsExplicit and implicit waits written by the teamBuilt-in retries for commands and assertions
Multiple tabs and windowsSupportedSupportedNot supported
Cross-origin flowsSupportedSupportedSupported with cy.origin
IframesSupported through frame locatorsSupported by switching framesPossible but awkward
Network interceptionBuilt inThrough BiDi or a proxyBuilt in
DebuggingTrace viewer, UI mode, video, screenshotsDepends on the framework and reporting addedInteractive runner with time-travel snapshots
Parallel runsBuilt-in workers and shardingSelenium Grid or a cloud providerThrough Cypress Cloud or CI configuration
MobileDevice emulation in desktop browsersReal devices through AppiumViewport emulation only

Where Playwright stands out

The main considerations are that the full-featured test runner is for JavaScript and TypeScript, while Python, Java and .NET use their usual test frameworks with the Playwright library, and that it tests patched browser builds rather than the exact branded browsers your users install, although it can also drive installed Chrome and Edge.

  • Automatic waiting reduces the timing-related flakiness that affects many older suites.
  • One API covers Chromium, Firefox and WebKit, so Safari-like behaviour can be tested on any operating system.
  • Browser contexts make it cheap to isolate tests and to test several users in one scenario.
  • The trace viewer records every action, network request, console message and DOM snapshot, which makes failures in CI much easier to diagnose.
  • API testing is built in, so tests can set up data through the API and check the interface in the same suite.
  • The test runner includes parallel workers, retries, sharding and HTML reports without extra plugins.

Where Selenium stands out

The trade-off is that Selenium is a library rather than a complete framework. Teams build their own structure, waiting strategy, reporting and parallel execution, and the quality of the suite depends heavily on that framework.

  • The widest language support, so tests can be written in the same language as the back end.
  • Based on a W3C standard, with drivers maintained by browser vendors.
  • Tests real branded browsers, including Safari on macOS.
  • Selenium Grid and many commercial device clouds support it at large scale.
  • Appium uses the same WebDriver approach, so skills transfer to mobile automation.
  • A very large community, a long track record and many existing enterprise suites.

Where Cypress stands out

The constraints are JavaScript or TypeScript only, no support for controlling multiple tabs, more limited browser coverage and an architecture that makes some flows, such as iframes and certain third-party redirects, harder. Parallelisation and the recorded dashboard are part of the paid Cypress Cloud service, although teams can also split runs themselves in CI.

  • An interactive runner that shows the application and each command, with snapshots you can step back through.
  • Quick to set up for JavaScript projects, with a developer-friendly API.
  • Built-in retries for commands and assertions reduce timing problems.
  • Component testing for popular front-end frameworks alongside end-to-end tests.
  • Network stubbing that makes it easy to test edge cases without a back end.

Which to choose for your situation

Recommendations by situation
SituationUsual recommendationWhy
New web project, no existing suitePlaywrightModern defaults, cross-browser, strong debugging
Large existing Selenium suite that worksKeep Selenium and improve the frameworkMigration cost rarely pays back
Back end in Java or C#, QA team writes tests in the same languagePlaywright for Java or .NET, or SeleniumShared language and tooling
Front-end team writing tests in TypeScriptPlaywright or CypressBoth suit developer-written tests
Must test real Safari or many browser versionsSelenium with a grid or cloudReal branded browsers at scale
Web and native mobile with one QA teamSelenium plus Appium, or Playwright plus AppiumWebDriver skills transfer to Appium
Multi-tab, multi-user or complex iframe flowsPlaywrightNative support for these patterns

Running each tool in CI

All three run headless in common CI systems such as GitHub Actions, GitLab CI, Azure Pipelines, Jenkins and Bitbucket Pipelines, and all provide official Docker images or guidance for containers.

Playwright's runner can split a suite into shards across CI machines and merge the reports, and it saves traces for failed tests so they can be opened after the run. Selenium suites usually rely on the test framework, such as JUnit, TestNG or pytest, for parallelism and reporting, and on Selenium Grid or a cloud provider for browser capacity. Cypress records screenshots and videos of failures; parallel runs and the hosted dashboard are provided through Cypress Cloud, or teams can split specs across CI jobs themselves.

Whatever the tool, publish failures somewhere the whole team sees them, keep artefacts such as traces or videos for a sensible period, and track flaky tests over time.

Learning curve and hiring

Cypress and Playwright are both quick to start with for developers familiar with JavaScript, and both have clear documentation. Selenium has a gentler start for testers who already know Java, Python or C#, and the largest pool of experienced engineers. Hiring is rarely the deciding factor, because experienced automation engineers move between these tools without much difficulty.

Should you migrate an existing suite?

Migrating a large suite is a project in its own right. Every test must be rewritten, re-verified and kept in sync with a product that keeps changing. Before migrating, ask whether the current pain comes from the tool or from the framework built around it. Fixed sleeps, brittle selectors, shared test data and tests that do too much cause flakiness in any tool.

If migration is justified, do it gradually. Write new tests in the new tool, migrate the most valuable and most flaky tests first, and retire old tests once their replacements are trusted. Keep both suites running in the pipeline during the transition and agree a date when the old suite stops being maintained.

Practices that matter more than the tool

  • Use stable selectors such as accessible roles, labels or dedicated test identifiers.
  • Never rely on fixed sleeps; wait for conditions.
  • Create and clean up test data through APIs so each test is independent.
  • Keep end-to-end tests focused on user journeys and push detailed rules down to API and unit tests.
  • Run tests on every change and make failures visible to the whole team.
  • Quarantine and fix flaky tests promptly rather than retrying them silently forever.

Our experience with all three

NUMVOX QA engineers work with Playwright, Selenium and Cypress. We have built Playwright suites in Java with Cucumber running in Bitbucket Pipelines, and we often recommend Playwright for new web suites. Where a client has a working Selenium or Cypress suite, we usually improve its framework, data handling and reporting rather than start again. The recommendation follows a short proof of concept on the client's own application.

Frequently asked questions

Is Playwright faster than Selenium?

Playwright suites are often faster in practice because of automatic waiting, lightweight browser contexts and built-in parallel workers. However, speed depends heavily on how tests are written, how much setup they do through the interface and how they run in the pipeline. A well-designed Selenium suite on a grid can also be fast. Measure with your own tests.

Can Cypress test multiple browser tabs?

No. Cypress does not support controlling more than one browser tab in a test. Teams usually work around this by removing the target attribute from links and checking the URL, or by testing the second page directly. If your critical journeys depend on several tabs or windows working together, Playwright or Selenium is usually a better fit.

Does Playwright support Java?

Yes. Playwright provides official libraries for Java, Python and .NET as well as JavaScript and TypeScript. The Java library is typically used with JUnit or TestNG, and can be combined with Cucumber for behaviour-driven scenarios. Some features of the JavaScript test runner, such as its built-in reporters and fixtures, are provided differently in other languages.

Is Selenium still worth learning?

Yes. Selenium remains widely used in enterprises, it is based on the W3C WebDriver standard and its concepts transfer directly to Appium for mobile testing. Many organisations will maintain Selenium suites for years. Learning Playwright as well is sensible, because the two cover most web automation work between them and share many underlying ideas.

Can we use more than one of these tools?

Yes, although it is best to keep the number small. A common pattern is Cypress or Playwright for front-end and component tests written by developers, with a separate end-to-end suite owned by QA. What matters is that every suite has a clear purpose and owner, runs in the pipeline and reports results in one place.

Which tool is best for testing mobile apps?

None of the three automates native mobile apps directly. Playwright and Cypress can emulate mobile viewports in desktop browsers, which is useful for responsive web testing. For native or hybrid apps on real devices, teams usually use Appium, or Espresso for Android and XCUITest for iOS. Appium shares the WebDriver approach with Selenium.

Sources

Planning a project like this?

Send a short brief and the NUMVOX team will reply by email with questions and a suggested next step.