# Playwright, Cypress, or Selenium: which one to choose with AI?

> For a new project, Playwright: the most advanced with AI. Cypress to get started fast, Selenium for a large existing suite. Criteria and use cases.

Source: https://qanary.dev/en/blog/choosing-an-ai-testing-framework  
Product: Qanary, no-code automated testing for e-commerce  
Site index for AI assistants: https://qanary.dev/en/llms.txt

[Blog](https://qanary.dev/en/blog) · Guide

For a new project, Playwright: the most advanced with AI. Cypress to get started fast, Selenium for a large existing suite. Criteria and use cases.

[Antoine Bouchet](https://qanary.dev/en/about#antoine), CEO of Qanary, November 17, 2025 · updated November 3, 2026 · 6 min read

For a new project, choose Playwright: it is currently the open-source testing framework best equipped to work with AI (driven by an assistant through MCP, agents that plan, write, and repair tests, built-in parallel runs). Cypress is still a good choice for a front-end team that wants to get started fast. Selenium mostly makes sense when you already have a large test suite to keep alive.

## In short

- AI adds criteria to choosing a framework: the quality of the code an assistant writes, an assistant driving the browser, and test repair.
- Playwright leads on these criteria: an MCP server released by Microsoft in 2025, and test agents since version 1.56 (October 2025).
- Cypress is the easiest to learn, and adds AI in small steps, with an experimental command that understands natural language.
- Selenium is still the W3C standard and supports every language, but it takes more code and more maintenance.
- Migrating a large test suite is expensive: write new tests in the new framework and keep the old ones running.

## What does AI change when you choose a framework?

It adds criteria. You used to compare speed, stability, ease of learning, and ecosystem. Those still matter. But if part of your tests is now written, read, or repaired by an AI assistant, you also need to look at:

1. **The quality of the code the assistant produces.** A short, readable API gives short, readable generated code. A verbose API gives verbose generated code, which you still have to review.
2. **An assistant driving the browser.** With the MCP protocol, an assistant like Claude or ChatGPT can open a browser, click, and read the page on its own.
3. **Test repair.** When the site changes, who fixes the tests: you, a plugin, or the framework itself?
4. **Running at scale.** An assistant writes two hundred tests in a morning. You still need to run them in parallel without spending the afternoon on it.
5. **Readable traces.** Screenshots, videos, and logs help you, but they also help the assistant that has to understand why a test fails.

## Playwright: the most advanced with AI

Playwright, released by Microsoft in 2020, is the open-source framework best equipped to work with AI. You can write it in TypeScript or JavaScript, but also Python, Java, and .NET, and it tests Chromium, Firefox, and WebKit (Safari’s engine).

What puts it ahead:

- **The [Playwright MCP](https://github.com/microsoft/playwright-mcp) server**, released by Microsoft in 2025: it lets an AI assistant drive a browser. It’s the one we use in the tutorial [Build a testing agent with Claude Code and Playwright](https://qanary.dev/en/blog/testing-agent-claude-code-playwright).
- **[Test agents](https://playwright.dev/docs/test-agents)**, since version 1.56 (October 2025): a planner that explores the application and writes a plan, a generator that turns it into tests, and a healer that fixes broken tests.
- **Parallel runs, built in and free**, and a trace viewer that replays every step of a test.
- **Selectors that describe what the user sees**, rather than the structure of the page:

// Fragile: breaks as soon as the ID changes await page.click('#login-btn-v2-2024'); // Robust: the button whose visible name is "Log in" await page.getByRole('button', { name: 'Log in' }).click();

One clarification, because the confusion is common: this is not self-healing. The second selector survives an ID change, not a renamed button. It breaks less often; it doesn’t repair itself. Repair is the agents’ job, and we cover it in [Self-healing: how AI repairs a broken test](https://qanary.dev/en/blog/self-healing-tests-with-ai).

**Its limits.** It takes longer to learn than Cypress for a team new to testing. Its plugin ecosystem is younger than Selenium’s. And its agents stay advisory: they suggest, you approve.

## Cypress: the easiest to learn

Cypress is the most pleasant framework for a front-end team discovering testing: you watch the test run in the browser, step back in time one step at a time, and the error messages are clear. AI assistants write good Cypress code, because that code is simple and very widespread.

On AI, Cypress moves in small steps. Its experimental [cy.prompt](https://www.cypress.io/releases/cy-prompt-experimental-release) command turns steps written in natural language into Cypress commands, which you can then keep as code.

**Its limits.**

- JavaScript and TypeScript only.
- It runs inside the browser: one tab at a time, WebKit (Safari) support still experimental, and nothing for native mobile apps.
- Parallel runs go through the vendor’s paid service, or through third-party tools.

## Selenium: the standard, for existing suites

Selenium is the veteran. It is the basis of the W3C WebDriver standard, can be written in Java, Python, C#, Ruby, or JavaScript, and a large part of the testing tools on the market are built around it. If your team only codes in Java and maintains thousands of Selenium tests, that’s reason enough to stay.

With AI, it is less well placed:

- **More code for the same test.** Assistants write it easily, but the result is longer, so it takes longer to review and maintain.
- **No built-in repair.** Self-healing goes through plugins like [Healenium](https://healenium.io), which is open source.
- **Parallel runs you have to set up.** You need to build and maintain a grid (Selenium Grid).

Selenium 4 modernized the protocol (WebDriver BiDi), but AI only comes in through outside tools.

## Which framework for which situation?

| Your situation | Our pick | Why |
| --- | --- | --- |
| New project, nothing existing | Playwright | Best equipped for AI, built-in parallel runs, several languages |
| Front-end team new to testing | Cypress | Learned in a few days, instant visual feedback |
| Existing Cypress suite that works well | Cypress | No rush: add AI in small steps |
| Need for Safari or multiple tabs | Playwright | Cypress is more limited on these points |
| Thousands of Selenium tests, Java team | Selenium | Migration costs more than it brings, at least in the short term |
| Older browsers, enterprise constraints | Selenium | The WebDriver standard covers the most cases |

## Should you switch frameworks?

Rarely all at once. The best guide is the size of your test suite (rough figures, not a rule):

1. **Fewer than a hundred tests**: migrating to Playwright costs little and pays off fast.
2. **Between one hundred and one thousand tests**: write new tests in Playwright, keep the old ones running, and migrate them when you have to touch them anyway.
3. **More than a thousand tests**: improve what you have (Selenium 4, Healenium, more robust selectors) and spread the transition over several years.

On Cypress, if the team is happy, stay. Look at Playwright if you hit limits with Safari, tabs, or run time.

Five mistakes come up often:

- **Choosing out of habit.** “We’ve been doing Selenium for ten years” describes your past, not your needs.
- **Ignoring AI.** Even if you don’t want it today, some of your next tests will probably be written with an assistant.
- **Migrating without a plan.** Switching everything in one week buys you a month without reliable tests.
- **Underestimating training.** A framework takes learning, even with an assistant at your side.
- **Choosing based on a benchmark.** Speed is only one criterion among others.

And not deciding is also a decision. Usually the wrong one.

## Testing without a framework, with Qanary

There is another answer: don’t choose a framework at all. Qanary, no-code automated testing for e-commerce, is for teams that want to test their shopping journeys without writing or maintaining code: you record the journey in a browser, Qanary replays it several times a day without AI, and AI is only used to create the tests, check how pages look, and repair the tests when the site changes. The other families of tools are covered in [Automated testing and AI: a map of the approaches](https://qanary.dev/en/blog/ai-testing-tools-map).

Want to see Qanary test your site? Book your free 30-minute test run with Julia or Antoine.

**Antoine Bouchet** Ten years in product management, on high-impact sites. He wants to raise the quality of online stores, with a product that does exactly what its users need. [More about Antoine](https://qanary.dev/en/about#antoine)

## Read next

- Guide
  ### [Build a testing agent with Claude Code and Playwright](https://qanary.dev/en/blog/testing-agent-claude-code-playwright)
  One folder, one command: Claude explores a site, plans its tests, runs them with Playwright, and delivers a report backed by proof. 15 minutes to set up.
  **Antoine Bouchet**, June 2, 2026 · 7 min read
- Talk
  ### [Self-healing: how AI repairs a broken test](https://qanary.dev/en/blog/self-healing-tests-with-ai)
  Self-healing repairs a test when the site changes. Three approaches with AI, from the most guided to the most autonomous, and their limits (ParisTestConf 2026).
  **Antoine Bouchet**, March 30, 2026 · 4 min read
- Talk
  ### [The quality mindset: how to ship flawless WordPress sites](https://qanary.dev/en/blog/quality-mindset-wordpress-sites)
  Define your critical journeys, document them in a spreadsheet, and move from reactive quality to quality you control: our talk at WordCamp Nice 2026.
  **Antoine Bouchet**, February 13, 2026 · 2 min read

[All articles](https://qanary.dev/en/blog)
