QA AND TEST AUTOMATION · PART 5 · UI WEB AUTOMATION · COMPARE · 53 OF 112

Selenium vs Playwright vs Cypress: Which to Use

A fair comparison of the three main web UI automation tools: how each one talks to the browser, languages, browsers, waiting, parallel runs, multi-tab and cross-origin support, debugging, mobile and ecosystem, then how to choose for a new project, when to keep an existing suite, and how to answer the comparison question in interviews without tool wars.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 67
  63. 68
  64. 69
  65. 70
  66. 71
  67. 72
  68. 73
  69. 74
  70. 75
  71. 76
  72. 77
  73. 78
  74. 79
  75. 80
  76. 81
  77. 82
  78. 83
  79. 84
  80. 85
  81. 86
  82. 87
  83. 88
  84. 89
  85. 90
  86. 91
  87. 92
  88. 93
  89. 94
  90. 95
  91. 96
  92. 97
  93. 98
  94. 99
  95. 100
  96. 101
  97. 102
  98. 103
  99. 104
  100. 105
  101. 106
  102. 107
  103. 108
  104. 109
  105. 110
  106. 111
  107. 112
1 / 12

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Three architectures
  • reach
  • waiting
  • tabs and origins
  • scale
  • debugging
  • ecosystem
  • choose by fit

Notes

Architecture

Start with architecture. Selenium sends W3C WebDriver commands to a separate driver for each browser, a web standard that browser vendors support, now extended with BiDi. Playwright keeps one fast connection to the browser and uses its own protocol with browser builds it ships. Cypress runs your test code inside the browser itself, next to the application. Almost every difference below comes from these three designs.

Under the hood
  • Selenium: W3C WebDriver via a driver per browser (+ BiDi)
  • Playwright: one persistent connection, its own protocol to patched browser builds
  • Cypress: test code runs INSIDE the browser, next to the app
  • design decides strengths

Languages and browsers

Reach. Selenium supports the most languages, including Java, Python, C sharp, JavaScript and Ruby, and the most real browsers, including real Safari through safari driver. Playwright supports TypeScript and JavaScript, Java, Python and dot net, and runs Chromium, Firefox and WebKit, the engine behind Safari, on every operating system. Cypress is JavaScript and TypeScript only, with Chromium based browsers and Firefox, and WebKit support marked experimental.

Reach
  • Selenium: Java, Python, C#, JS, Ruby, Kotlin Chrome, Firefox, Edge, real Safari (safaridriver)
  • Playwright: TS/JS, Java, Python, .NET Chromium, Firefox, WebKit
  • Cypress: JavaScript/TypeScript Chromium family, Firefox (WebKit experimental)

Waiting and flakiness

Waiting. In Selenium you write explicit waits yourself, which is more work and more room for mistakes. Playwright auto waits before actions and its assertions retry. Cypress also retries queries and assertions automatically. Auto waiting removes a whole class of timing flakiness, but no tool fixes flaky test design: shared data, order dependencies and unstable environments stay your job in all three.

Synchronization
  • Selenium: you write explicit waits (WebDriverWait)
  • Playwright: auto-waiting actions + retrying expect
  • Cypress: commands retry; its assertions retry the query
  • all three: flaky if the test design is flaky (data, order)

Hard scenarios

Hard scenarios show the design differences. Multiple tabs or windows: Selenium and Playwright handle them; Cypress, running inside one tab, does not. Several websites in one test, such as a login on another domain: Selenium and Playwright just work; Cypress needs its origin command. Iframes, uploads and downloads work in all three, with more workarounds in Cypress. All three can make API calls for setup.

Capability differences
  • multiple tabs/windows Sel yes · PW yes · Cy no several origins in one test Sel yes · PW yes Cy via cy.origin()
  • iframes, downloads, uploads all three, Cypress needs more workarounds
  • API calls in tests: all three

Speed and scale

Scale. Selenium parallelises through your test runner, such as JUnit, TestNG or pytest x dist, and distributes across machines with Selenium Grid or cloud grids. Playwright has parallel workers and sharding across machines built in and free. Cypress parallelisation is mainly through its paid cloud service or community plugins. Speed claims vary by suite, so measure on your own tests rather than trusting benchmarks.

Running many tests
  • Selenium: Grid 4 or cloud grids; parallel via JUnit, TestNG or pytest-xdist
  • Playwright: workers and --shard built in, free
  • Cypress: parallel via its paid Cloud service or community plugins
  • measure on YOUR suite

Developer experience

Day to day experience. Cypress's interactive runner, with time travel through each command in the real browser, is loved by front end developers. Playwright offers the trace viewer, UI mode, the inspector and codegen, which you met two episodes ago. Selenium relies more on your IDE debugger, screenshots and logs, and on whatever your framework adds. All three integrate with CI and common reporters.

Debugging
  • Cypress: time-travel runner in the browser, very friendly for front-end devs
  • Playwright: trace viewer, UI mode, codegen, inspector
  • Selenium: your IDE debugger, screenshots, logs; tools depend on your framework

Ecosystem

Selenium's ecosystem keeps it important. Many companies have large Java Selenium suites that work. Appium, the main mobile automation tool in Part six, uses the same WebDriver protocol, so the skills transfer. Cloud browser and device grids were built around it. And as a W3C standard, browser vendors maintain the drivers. That is why many job descriptions still ask for Selenium, often alongside Playwright.

Why Selenium stays
  • huge existing Java suites
  • Appium (mobile) uses the WebDriver protocol: same skills for Part 6
  • cloud device and browser grids built around it
  • W3C standard: vendors own the drivers
  • many jobs still list it

How to choose

A decision guide. For a new web project, Playwright is a strong default today: multiple browsers, languages, auto waiting and free parallelism. If front end developers will own the tests and the app targets Chromium based browsers, Cypress is a good fit. If you have a large Selenium suite that works, keep it; rewriting costs a lot and finds few bugs, so move only where the new tool clearly pays off. If you need real Safari or a language only Selenium supports, choose Selenium.

A decision guide
  • new web project, any team → Playwright is a strong default
  • front-end devs own tests, Chromium focus → Cypress
  • big working Selenium suite → keep it; add new tests in the new tool only if worth it
  • real Safari or many languages → Selenium

Common mistakes

Choosing tools badly. Picking by hype or a single benchmark. Rewriting a stable suite just because the tool is older. Ignoring who will maintain the tests and which languages they know. Running two tools for the same job forever, with half the tests in each. And deciding without a small proof of concept on your real application's hardest screens.

Avoid these
  • choosing by hype or one blog benchmark
  • rewriting a stable suite "because it's old"
  • ignoring who will maintain the tests
  • two tools for the same job forever
  • no proof-of-concept on your real app

Say it like this

In the interview: both are good, and it depends on context. Selenium is the W3C standard, with the most languages and real browsers, Grid, a huge ecosystem, and the same protocol as Appium. Playwright brings auto waiting, tracing, built in parallelism and easy multi tab and multi origin tests. For a new web project I would run a proof of concept with Playwright, and I would not rewrite a stable Selenium suite for its own sake.

In the interview
  • "Both are good; it depends.
  • Selenium: W3C standard, most
  • languages and real browsers, Grid, big existing suites, same protocol as Appium.
  • Playwright: auto-waiting, tracing, built-in parallel and multi-tab. For a new web
  • project I would POC Playwright;
  • I would not rewrite a stable
  • Selenium suite for its own sake."

Interview questions

Q1What is the main architectural difference between Selenium, Playwright and Cypress?

Selenium uses the W3C WebDriver protocol through per-browser drivers; Playwright uses its own persistent protocol to browser builds; Cypress runs test code inside the browser alongside the app.

Q2Which browsers does Playwright support?

Chromium (including Chrome and Edge channels), Firefox and WebKit, on Windows, macOS and Linux.

Q3What are Cypress's main limitations?

JavaScript/TypeScript only, no multiple tabs, cross-origin flows need cy.origin(), WebKit support is experimental, and parallelisation is mainly through its paid cloud or plugins.

Q4Why do many companies still use Selenium?

Large working suites, many languages, real browser coverage including Safari, Grid and cloud grids, and protocol compatibility with Appium.

Q5Would you migrate a Selenium suite to Playwright?

Only with a clear payoff (flakiness, speed, maintenance) proven by a pilot; often new tests go to the new tool and stable old tests stay.

Q6Which tool auto-waits?

Playwright (actionability checks and retrying assertions) and Cypress (retrying queries and assertions); Selenium needs explicit waits.

Q7How do you run tests in parallel in each tool?

Selenium via the test runner and Grid; Playwright with workers and --shard; Cypress mainly via its cloud service or plugins.

Q8How should a team choose a UI automation tool?

By application needs (browsers, tabs, origins), team languages and ownership, existing suites, CI and budget, confirmed with a proof of concept on the real app.