| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
page.screenshot() and locator.screenshot() can now capture screenshots in the WebP format. Playwright infers the format from a .webp file extension, or you can set the type explicitly. Quality 100 (the default) is lossless, while lower values use lossy compression:
page.screenshot(path="homepage.webp", quality=50)This version was also tested against the following stable channels:
New Credentials virtual authenticator, available via browserContext.credentials, lets tests register passkeys and answer navigator.credentials.create() / navigator.credentials.get() ceremonies in the page — no real hardware key required, works in all browsers:
context = browser.new_context()
# Seed a passkey your backend provisioned for a test user.
context.credentials.create("example.com",
id=credential_id,
user_handle=user_handle,
private_key=private_key,
public_key=public_key,
)
context.credentials.install()
page = context.new_page()
page.goto("https://example.com/login")
# The page's navigator.credentials.get() is answered with the seeded passkey.You can also let the app register a passkey once in a setup test, read it back with credentials.get(), and seed it into later tests — see Credentials for details.
New WebStorage API, available via page.localStorage and page.sessionStorage, reads and writes the page's storage for the current origin:
page.local_storage.set_item("token", "abc")
token = page.local_storage.get_item("token")
items = page.session_storage.items()This version was also tested against the following stable channels:
tracing.start_har() / tracing.stop_har() expose HAR recording as a first-class tracing API, with the same content, mode and url_filter options as record_har:
context.tracing.start_har("trace.har")
page = context.new_page()
page.goto("https://playwright.dev")
context.tracing.stop_har()New locator.drop() simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches dragenter, dragover, and drop with a synthetic DataTransfer in the page context — works cross-browser and is great for testing upload zones:
page.locator("#dropzone").drop(
files={"name": "note.txt", "mime_type": "text/plain", "buffer": b"hello"},
)
page.locator("#dropzone").drop(
data={
"text/plain": "hello world",
"text/uri-list": "https://example.com",
},
)This version was also tested against the following stable channels:
New page.screencast API provides a unified interface for capturing page content with:
Screencast recording — record video with precise start/stop control, as an alternative to the recordVideoDir option:
page.screencast.start(path="video.webm")
# ... perform actions ...
page.screencast.stop()Action annotations — enable built-in visual annotations that highlight interacted elements and display action titles during recording:
page.screencast.show_actions(position="top-right")screencast.show_actions() accepts position ('top-left', 'top', 'top-right', 'bottom-left', 'bottom', 'bottom-right'), duration (ms per annotation), and font_size (px). Returns a disposable to stop showing actions.
Visual overlays — add chapter titles and custom HTML overlays on top of the page for richer narration:
page.screencast.show_chapter("Adding TODOs",
description="Type and press enter for each TODO",
duration=1000,
)
page.screencast.show_overlay('<div style="color: red">Recording</div>')Real-time frame capture — stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:
page.screencast.start(
on_frame=lambda frame: send_to_vision_model(frame["data"]),
)Agentic video receipts — coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:
page.screencast.start(path="receipt.webm")
page.screencast.show_actions(position="top-right")
page.screencast.show_chapter("Verifying checkout flow",
description="Added coupon code support per ticket #1234",
)
# Agent performs the verification steps...
page.locator("#coupon").fill("SAVE20")
page.locator("#apply-coupon").click()
expect(page.locator(".discount")).to_contain_text("20%")
page.screencast.show_chapter("Done",
description="Coupon applied, discount reflected in total",
)
page.screencast.stop()The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.
New browser.bind() API makes a launched browser available for playwright-cli, @playwright/mcp, and other clients to connect to.
Bind a browser — start a browser and bind it so others can connect:
server_info = await browser.bind("my-session",
workspace_dir="/my/project",
)Connect from playwright-cli — connect to the running browser from your favorite coding agent.
playwright-cli attach my-session
playwright-cli -s my-session snapshotConnect from @playwright/mcp — or point your MCP server to the running browser.
@playwright/mcp --endpoint=my-sessionConnect from a Playwright client — use API to connect to the browser. Multiple clients at a time are supported!
browser = await chromium.connect(server_info["endpoint"])Pass host and port options to bind over WebSocket instead of a named pipe:
server_info = await browser.bind("my-session",
host="localhost",
port=0,
)
# server_info["endpoint"] is a ws:// URLCall browser.unbind() to stop accepting new connections.
Run playwright-cli show to open the Dashboard that lists all the bound browsers, their statuses, and allows interacting with them:
This version was also tested against the following stable channels:
Thanks to @cpAdm for contributing these improvements!
browser_type.connect_over_cdp() now accepts an is_local option. When set to True, it tells Playwright that it runs on the same host as the CDP server, enabling file system optimizations.
This version was also tested against the following stable channels:
Starting with this release, Playwright switches from Chromium, to using Chrome for Testing builds. Both headed and headless browsers are subject to this. Your tests should still be passing after upgrading to Playwright 1.57.
We're expecting no functional changes to come from this switch. The biggest change is the new icon and title in your toolbar.
If you still see an unexpected behaviour change, please file an issue.
On Arm64 Linux, Playwright continues to use Chromium.
After 3 years of being deprecated, we removed page.accessibility from our API. Please use other libraries such as Axe if you need to test page accessibility. See our Node.js guide for integration with Axe.
This version was also tested against the following stable channels:
New cookie property partition_key in BrowserContext.cookies() and browserContext.add_cookies(). This property allows to save and restore partitioned cookies. See CHIPS MDN article for more information. Note that browsers have different support and defaults for cookie partitioning.
New option --user-data-dir in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
playwright codegen --user-data-dir=./user-dataplaywright open does not open the test recorder anymore. Use playwright codegen instead.
This version was also tested against the following stable channels:
New method locator.describe() to describe a locator. Used for trace viewer.
button = page.get_by_test_id("btn-sub").describe("Subscribe button")
button.click()python -m playwright install --list will now list all installed browsers, versions and locations.
This version was also tested against the following stable channels:
| Back | FazBrowse Home | New Git URL |