🌐 HAR recording on Tracing
tracing.startHar() / tracing.stopHar() expose HAR recording as a first-class tracing API, with the same content, mode and urlFilter options as recordHar:
context.tracing().startHar(Paths.get("trace.har"));
Page page = context.newPage();
page.navigate("https://playwright.dev");
context.tracing().stopHar();🪝 Drop API
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(new Locator.DropPayload()
.setFiles(new FilePayload("note.txt", "text/plain", "hello".getBytes(StandardCharsets.UTF_8))));
page.locator("#dropzone").drop(new Locator.DropPayload()
.setData(Map.of(
"text/plain", "hello world",
"text/uri-list", "https://example.com")));🎯 Aria snapshots
- assertThat(page).matchesAriaSnapshot() now works on a Page, in addition to a Locator — equivalent to asserting against
page.locator("body"). - New
boxesoption on locator.ariaSnapshot() / page.ariaSnapshot() appends each element's bounding box as[box=x,y,width,height], useful for AI consumption.
New APIs
Browser, Context and Page
- Event browser.onContext() — fired when a new context is created on the browser.
- BrowserContext now mirrors lifecycle events from its pages: browserContext.onDownload(), browserContext.onFrameAttached(), browserContext.onFrameDetached(), browserContext.onFrameNavigated(), browserContext.onPageClose(), browserContext.onPageLoad().
Locators and Assertions
- New option
descriptionin page.getByRole() / locator.getByRole() / frame.getByRole() / frameLocator.getByRole() for matching the accessible description. - New option
pseudoin assertThat(locator).hasCSS() reads computed styles from::beforeor::after. - New option
stylein locator.highlight() applies extra inline CSS to the highlight overlay, plus new page.hideHighlight() to clear all highlights.
Network
- webSocketRoute.protocols() returns the WebSocket subprotocols requested by the page.
- New option
noDefaultsin browserType.connectOverCDP() disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.
Errors
- New webError.location() mirrors consoleMessage.location().
🛠️ Other improvements
- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.
Breaking Changes ⚠️
- Removed long-deprecated
handleoption onBrowserContext.exposeBindingandPage.exposeBinding.
Browser Versions
- Chromium 148.0.7778.96
- Mozilla Firefox 150.0.2
- WebKit 26.4
This version was also tested against the following stable channels:
- Google Chrome 147
- Microsoft Edge 147