| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-04-09 | 9.8 kB | |
| v1.59.0 source code.tar.gz | 2026-04-09 | 2.2 MB | |
| v1.59.0 source code.zip | 2026-04-09 | 2.7 MB | |
| Totals: 3 Items | 4.9 MB | 0 | |
🎬 Screencast
New page.screencast API provides a unified interface for capturing page content with:
- Screencast recordings
- Action annotations
- Visual overlays
- Real-time frame capture
- Agentic video receipts
Screencast recording — record video with precise start/stop control, as an alternative to the recordVideoDir option:
:::java
page.screencast().start(new Screencast.StartOptions().setPath(Paths.get("video.webm")));
// ... perform actions ...
page.screencast().stop();
Action annotations — enable built-in visual annotations that highlight interacted elements and display action titles during recording:
:::java
page.screencast().showActions(new Screencast.ShowActionsOptions().setPosition("top-right"));
screencast.showActions() accepts position ("top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"), duration (ms per annotation), and fontSize (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:
:::java
page.screencast().showChapter("Adding TODOs",
new Screencast.ShowChapterOptions()
.setDescription("Type and press enter for each TODO")
.setDuration(1000));
page.screencast().showOverlay("<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:
:::java
page.screencast().start(new Screencast.StartOptions()
.setOnFrame(frame -> sendToVisionModel(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:
:::java
page.screencast().start(new Screencast.StartOptions()
.setPath(Paths.get("receipt.webm")));
page.screencast().showActions(new Screencast.ShowActionsOptions().setPosition("top-right"));
page.screencast().showChapter("Verifying checkout flow",
new Screencast.ShowChapterOptions()
.setDescription("Added coupon code support per ticket #1234"));
// Agent performs the verification steps...
page.locator("#coupon").fill("SAVE20");
page.locator("#apply-coupon").click();
assertThat(page.locator(".discount")).containsText("20%");
page.screencast().showChapter("Done",
new Screencast.ShowChapterOptions()
.setDescription("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.
🔍 Snapshots and Locators
- Method page.ariaSnapshot() to capture the aria snapshot of the page — equivalent to
page.locator("body").ariaSnapshot(). - Options
depthandmodein locator.ariaSnapshot(). - Method locator.normalize() converts a locator to follow best practices like test ids and aria roles.
- Method page.pickLocator() enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its Locator back. Use page.cancelPickLocator() to cancel.
New APIs
Screencast
- page.screencast provides video recording, real-time frame streaming, and overlay management.
- Methods screencast.start() and screencast.stop() for recording and frame capture.
- Methods screencast.showActions() and screencast.hideActions() for action annotations.
- Methods screencast.showChapter() and screencast.showOverlay() for visual overlays.
- Methods screencast.showOverlays() and screencast.hideOverlays() for overlay visibility control.
Storage, Console and Errors
- Method browserContext.setStorageState() clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state — no need to create a new context.
- Methods page.clearConsoleMessages() and page.clearPageErrors() to clear stored messages and errors.
- Option
filterin page.consoleMessages() and page.pageErrors() controls which messages are returned. - Method consoleMessage.timestamp().
Miscellaneous
- browserContext.debugger() provides programmatic control over the Playwright debugger.
- Method browserContext.isClosed().
- Method request.existingResponse() returns the response without waiting.
- Method response.httpVersion() returns the HTTP version used by the response.
- Option
livein tracing.start() for real-time trace updates. - Option
artifactsDirin browserType.launch() to configure the artifacts directory.
đź”— Interoperability
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:
:::java
Browser.BindResult serverInfo = browser.bind("my-session",
new Browser.BindOptions().setWorkspaceDir("/my/project"));
Connect from playwright-cli — connect to the running browser from your favorite coding agent.
:::bash
playwright-cli attach my-session
playwright-cli -s my-session snapshot
Connect from @playwright/mcp — or point your MCP server to the running browser.
:::bash
@playwright/mcp --endpoint=my-session
Connect from a Playwright client — use API to connect to the browser. Multiple clients at a time are supported!
:::java
Browser browser = chromium.connect(serverInfo.endpoint);
Pass host and port options to bind over WebSocket instead of a named pipe:
:::java
Browser.BindResult serverInfo = browser.bind("my-session",
new Browser.BindOptions().setHost("localhost").setPort(0));
// serverInfo.endpoint is a ws:// URL
Call browser.unbind() to stop accepting new connections.
📊 Observability
Run playwright-cli show to open the Dashboard that lists all the bound browsers, their statuses, and allows interacting with them:
- See what your agent is doing on the background browsers
- Click into the sessions for manual interventions
- Open DevTools to inspect pages from the background browsers.
playwright-clibinds all of its browsers automatically, so you can see what your agents are doing.- Pass
PLAYWRIGHT_DASHBOARD=1env variable to see all@playwright/testbrowsers in the dashboard.
Breaking Changes ⚠️
- Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.
Browser Versions
- Chromium 147.0.7727.15
- Mozilla Firefox 148.0.2
- WebKit 26.4
This version was also tested against the following stable channels:
- Google Chrome 146
- Microsoft Edge 146