Python version of the Playwright testing and automation library.
Repo microsoft/playwright-python, read from GitHub 18 min ago. microsoft has not joined Take My Repo.
microsoft/playwright#44098 - browser(chromium): roll to r1255, v159.0.8154.6
#3337 - chore: roll Node.js to 26.13.1
#3331 - devops(docker): install libatomic1 for the Node.js binary of the driver
#3336 - fix(docker): upgrade base image packages during the build
The bundled Node.js 26.13.1 is a security release with fixes in tls, http, https and http2. The driver uses Node.js for its own network connections, for example connect_over_cdp to a wss:// endpoint.
The Docker images now include libatomic1, which the Node.js binary of the driver needs, and the latest security updates of the Ubuntu packages.
This version was also tested against the following stable channels:
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")
timeout in cdp_session.send().Actions such as locator.click(), locator.check(), locator.tap(), locator.fill(), locator.clear() and locator.select_option() now wait for the element to be not inert. An action on an element with the inert attribute, or inside such an element, now times out if the element stays inert.
Cookie matching now follows RFC 6265. With a URL, browser_context.cookies() and api_request_context.cookies() no longer return host-only cookies for subdomains or Path=/api cookies for /apiv2, and a Path=/foo/ cookie does not match /foo. APIRequestContext sends a cookie without a name as Cookie: x instead of Cookie: =x, and stores Set-Cookie: token as a cookie without a name.
Proxy credentials are no longer sent to websites. The credentials in the proxy option now answer only proxy challenges. To authenticate on a website, use http_credentials.
Text that the browser does not render, such as text that is not assigned to a slot or text directly inside a closed <details>, is no longer part of accessible names and aria snapshots. This can change the results of page.get_by_role() with a name, locator.aria_snapshot() and expect(locator).to_match_aria_snapshot().
String values of the params option in APIRequestContext requests are now appended to the query that the URL already has, instead of replacing it.
pip install --no-binary :all: and Poetry with installer.no-binary. An install from the source distribution uses a pre-installed Node.js that you set with PLAYWRIGHT_NODEJS_PATH.pyee is not a dependency anymore, so it no longer conflicts with packages that need a different version of it.This version was also tested against the following stable channels:
#3283 - chore: roll Node.js to 24.22.1
The bundled Node.js 24.22.1 is a security release that distrusts the compromised eMudhra intermediate CAs. The driver uses Node's CA store for its own TLS connections, for example connect_over_cdp to a wss:// endpoint.
This version was also tested against the following stable channels:
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"}'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( style={ "point": "width: 20px; height: 20px; border-radius: 50%; background: red", "highlight": "outline: 2px solid #333; background: rgba(0, 128, 255, .15)", "title": "font-size: 16px", } )
record_video_fps option and new fps option instyle option takes CSS declarations for the point marker, the targethighlight and the action title. It replaces the font_size option, which is now deprecated.playwright-cli.New locator.within() combines two locators that you already have, reading in the natural order —
"this button, within that dialog":
save_button = page.get_by_role("button", name="Save") dialog = page.get_by_test_id("settings-dialog") save_button.within(dialog).click()
Relative locators such as locator.nth() or locator.first are resolved inside each parent
separately, which makes column-like queries straightforward:
# The third cell of every row, not the third cell in the table. third_column = page.get_by_role("cell").nth(2).within(page.get_by_role("row")) expect(third_column).to_have_text(["Apple", "Banana", "Cherry"])
New page.get_by_ref() locates an element by its aria ref, such as e2, reported by page.aria_snapshot() in the "ai" mode.
New option include_shadow in page.content() and frame.content() serializes open shadow roots as declarative shadow DOM.
New option sign_count sets the initial signature counter of a virtual credential. credentials.create() and credentials.get() return the current sign_count, and it is saved and restored together with the credentials in the storage state.
New api_request_context.add_cookies(), api_request_context.cookies() and api_request_context.clear_cookies() manage cookies of a request context, mirroring the BrowserContext methods:
request.add_cookies( [{"name": "session-id", "value": "42", "url": "https://example.com"}] ) print(request.cookies("https://example.com")) request.clear_cookies(name="session-id")
visibility: hidden, are now considered hidden by actions, locator.is_visible() and expect(locator).to_be_visible().This version was also tested against the following stable channels:
page.frame_locator() and frame.frame_locator() called without a selector search in any frame of the
subtree, so you no longer need to locate the iframe first:
# Finds the button in any frame on the page. page.frame_locator().get_by_role("button").click()
The rest of the locator resolves inside a single frame, just like a regular locator, and an error is thrown when it
matches elements in several frames.
New locator.visible returns a locator that matches only visible elements. It is the recommended
replacement for the :visible CSS pseudo-class:
page.locator("button").visible.click()
New aria_snapshots and screen_snapshots options of
tracing.start() capture an aria snapshot and a screenshot of the page on every action:
context.tracing.start(snapshots=True, aria_snapshots=True, screen_snapshots=True)
With aria and screen snapshots recorded, the new Display Aria mode in the trace viewer shows the action screenshot
side by side with the aria snapshot, and hovering an aria node highlights it on the screenshot.
http_credentials now also accepts an array of credentials. The first entry matching the request origin is used, and entries without an origin match any request.opfs includes the origin private file system in the storage state, so it can be persisted and restored into later contexts.playwright install --no-remove keeps the browsers of other Playwright installations instead of removing them.playwright codegen --http-credentials records against pages behind HTTP authentication.This version was also tested against the following stable channels: