Playwright 1.64: what's new for test automation (WebMCP, locator.within(), --shuffle)
Playwright 1.64 adds WebMCP tool testing, locator.within(), --shuffle, optional projects, better videos and API cookie control. What each feature means for end-to-end test automation, with plain examples and an upgrade checklist.
🎭 Playwright 1.64 is here, and it’s not a “minor bump” kind of release.
If your team runs end-to-end test automation with Playwright, this release changes how you find elements, how you catch tests that depend on each other, and how you test sites that AI assistants can use. Here’s what got us excited, what to check before you upgrade, and where Playwright now stands next to Cypress and Selenium 👇
🧰 WebMCP support
Websites are starting to offer “tools” that AI assistants can use directly, like a search box built for AI instead of humans. Playwright can now test those tools just like it tests buttons and forms.
🪆 locator.within()
Finding an element inside another element is now as easy as saying it out loud.
It also works for tables. Want the 3rd column of every row? One line, no loops.
🎲 --shuffle
Sometimes tests only pass because they run in a lucky order. Shuffle mixes the order up so these hidden problems surface early. For anyone fighting flaky tests in a large regression suite, this is the feature to try first.
🎯 Projects with default: false
Keep all your browsers in one setup, but only run the ones you need right now. This keeps cross-browser testing in one config file without slowing down every local run.
🎬 Better videos
Test recordings now look much more professional:
- Smoother playback, up to 60 frames per second
- You choose how clicks and highlights look (colour, size, style)
- The mouse cursor moves naturally, like a real user’s
- Smaller video files that use less computer power
🍪 Cookie control for API tests
You can now add, read and clear cookies directly in API tests, without opening a browser. That makes Playwright a stronger choice for API test automation that sits next to your browser tests.
If API testing is your main interest, our guide to API testing with Jest and Supertest covers the mistakes that make a backend suite misleading.
⚠️ Before you upgrade
- Device presets now apply the full screen size. If you test as “iPhone”, the page now really believes it’s on an iPhone-sized screen, so mobile layouts may change in your screenshots.
- Hidden frames are treated as hidden. If an iframe is invisible on the page, Playwright now treats everything inside it as invisible too.
- Missing screenshots no longer fail the run. When a test creates a brand-new baseline screenshot in “missing” mode, it now passes instead of failing.
How to upgrade to Playwright 1.64 safely
A Playwright upgrade should be boring. This is the order we follow on client suites:
- Upgrade on a branch, never straight on the main line.
- Run the full regression suite once and read every failure. Do not retry until green.
- Review mobile screenshots first. The device preset change is the most likely source of visual differences.
- Search for tests that rely on hidden iframes. Those are the ones the frame change can break.
- Add
--shuffleas a separate, non-blocking CI job. Let it report order-dependent tests for a week before you make it a gate. - Merge when the diff is understood, not when it is merely green.
The previous release, 1.63
1.63 added test locks and locator.visible():
- Test locks: two tests that use the same thing, like one test account, won’t run at the same time and break each other.
- locator.visible(): click only the button the user can actually see, and ignore hidden copies.
Playwright vs Cypress vs Selenium: which should you choose?
We build automation in all three, and the honest answer is that the right tool depends on the application and the team.
- Playwright suits modern web apps that need fast, parallel, cross-browser runs. Releases like this one, with tool testing for AI assistants, are why many teams starting fresh now pick it.
- Cypress suits front-end teams who want tests to feel like part of development, with an interactive runner that developers enjoy using.
- Selenium suits organisations with large existing suites, several programming languages, or browsers and environments the newer tools do not reach.
Moving an existing suite is a bigger decision than choosing a tool for a new one. A stable Selenium or Cypress suite that your team trusts is worth more than a rewrite.
How we use Playwright on client projects
The framework matters less than how the suite is built. On every Playwright project we set up:
- Page objects and one house style, so tests read the same whoever wrote them.
- Independent test data, with each test creating and removing its own, so tests can run in parallel and in any order.
- CI/CD from day one, in GitHub Actions, Jenkins or Azure DevOps, so the suite runs on every change.
That approach is what took one inherited suite from a 6-hour nightly run to 11 minutes.
Where this is heading
The direction is clear: Playwright isn’t just a browser automation tool anymore. It’s becoming the testing layer for the agentic web. 🤖
We have written about what happens when you let an AI agent drive Playwright, and our own AutoQA Agent is built on it.
Frequently asked questions
- What is new in Playwright 1.64?
- Playwright 1.64 adds WebMCP support for testing the tools a website offers to AI assistants, locator.within() for finding an element inside another element, a --shuffle option that runs tests in random order, projects that can be switched off by default, smoother test videos and cookie control for API tests.
- Is Playwright 1.64 a breaking upgrade?
- It has three behaviour changes to check. Device presets now apply the full screen size, hidden iframes are treated as hidden, and a test that creates a new baseline screenshot now passes. Upgrade on a branch and review mobile screenshots before merging.
- What is WebMCP testing?
- WebMCP lets a website offer tools that AI assistants can call directly, such as a product search. WebMCP testing means calling those tools from an automated test and checking the result, the same way you would test a button or a form.
- Is Playwright better than Selenium or Cypress?
- It depends on the application and the team. Playwright suits modern web apps that need fast cross-browser runs, Cypress suits front-end teams who want an interactive runner, and Selenium suits large existing suites and wider language and browser support.
- How does --shuffle help with flaky tests?
- Some tests only pass because an earlier test left the application in a convenient state. Running tests in random order exposes that dependency, and the seed number lets you repeat the exact order to fix it.
Want to see what automated testing finds in your own application? Our free test run puts our AutoQA Agent on your staging site and gives you the results in 48 hours.