Skip to main content

Release notes

Version 1.65​

🧾 Locator code in Python​

A locator from locator.normalize() now converts to a string as Python code. Use it with page.get_by_ref() to turn an element that an agent picks from a page.aria_snapshot() in the "ai" mode into code for your test:

normalized = page.get_by_ref("e2").normalize()
print(str(normalized))
# get_by_role("button", name="Submit")

New APIs​

Breaking Changes ⚠️​

Browser Versions​

  • Chromium 158.0.8127.18
  • Mozilla Firefox 159.0
  • WebKit 27.2

This version was also tested against the following stable channels:

  • Google Chrome 157
  • Microsoft Edge 156

Version 1.64​

🧰 WebMCP​

New page.webmcp and frame.webmcp give access to the tools that a page registers through the experimental WebMCP browser API, so you can test them like any other part of your app:

browser = chromium.launch(args=["--enable-features=WebMCP"])
page = browser.new_page()
page.goto("https://example.com")

for tool in page.webmcp.tools():
print(tool["name"], tool["description"])

result = page.webmcp.call_tool("add", {"a": 2, "b": 40})
print(result["content"][0]["text"]) # "42"

Playwright MCP also supports WebMCP by default, with page-defined tools offered to the agent as webmcp_<tool>. Pass --no-webmcp to opt out.

playwright-cli exposes them as well:

playwright-cli webmcp-list
playwright-cli webmcp-call search_catalog --params '{"query":"cats"}'

🎬 Better videos​

Videos can now be recorded at a custom frame rate, and the decorations for actions are styled with plain CSS:

page.screencast.start(path="video.webm", size={"width": 1920, "height": 1080}, fps=60)
page.screencast.show_actions