Guide
Build a testing agent with Claude Code and 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.
Create your tests
Run them
Keep them up to date
By stage
Who it’s for
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.
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.
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:
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:
// 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.
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 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 command turns steps written in natural language into Cypress commands, which you can then keep as code.
Its limits.
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:
Selenium 4 modernized the protocol (WebDriver BiDi), but AI only comes in through outside tools.
| 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 |
Rarely all at once. The best guide is the size of your test suite (rough figures, not a rule):
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:
And not deciding is also a decision. Usually the wrong one.
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.
Want to see Qanary test your site? with Julia or Antoine.
Guide
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.
Talk
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).
Talk
Define your critical journeys, document them in a spreadsheet, and move from reactive quality to quality you control: our talk at WordCamp Nice 2026.
Bugs only. Promise.
30 minutes, live on your site
Shall we look at your site together?