💬 Custom assertion messages
Expect() overloads now accept a custom message that is prepended to any failure, giving extra context in test reports:
await Expect(page.Locator("#status"), "Should be logged in").ToBeVisibleAsync();When the assertion fails, the message is prefixed:
Should be logged in
Locator expected to be visible
🌐 HAR recording on Tracing
Tracing.StartHarAsync() / Tracing.StopHarAsync() expose HAR recording as a first-class tracing API, with the same Content, Mode and UrlFilter options as RecordHar:
await context.Tracing.StartHarAsync("trace.har");
var page = await context.NewPageAsync();
await page.GotoAsync("https://playwright.dev");
await context.Tracing.StopHarAsync();🪝 Drop API
New Locator.DropAsync() 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:
await page.Locator("#dropzone").DropAsync(new() {
Files = new FilePayload() {
Name = "note.txt",
MimeType = "text/plain",
Buffer = Encoding.UTF8.GetBytes("hello"),
},
});
await page.Locator("#dropzone").DropAsync(new() {
Data = new Dictionary<string, string> {
["text/plain"] = "hello world",
["text/uri-list"] = "https://example.com",
},
});🎯 Aria snapshots
- Expect(page).ToMatchAriaSnapshotAsync() now works on a Page, in addition to a Locator — equivalent to asserting against
Page.Locator("body"). - New
Boxesoption on Locator.AriaSnapshotAsync() / Page.AriaSnapshotAsync() appends each element's bounding box as[box=x,y,width,height], useful for AI consumption.
New APIs
Browser, Context and Page
- Event Browser.Context — fired when a new context is created on the browser.
- BrowserContext now mirrors lifecycle events from its pages: BrowserContext.Download, BrowserContext.FrameAttached, BrowserContext.FrameDetached, BrowserContext.FrameNavigated, BrowserContext.PageClose, BrowserContext.PageLoad.
Pagenow implementsIAsyncDisposable— pages can be used withawait usingfor automatic cleanup.
Locators and Assertions
- New option
Descriptionin Page.GetByRole() / Locator.GetByRole() / Frame.GetByRole() / FrameLocator.GetByRole() for matching the accessible description. - New option
Pseudoin Expect(locator).ToHaveCSSAsync() reads computed styles from::beforeor::after. - New option
Stylein Locator.HighlightAsync() applies extra inline CSS to the highlight overlay, plus new Page.HideHighlightAsync() to clear all highlights.
Network
- WebSocketRoute.Protocols returns the WebSocket subprotocols requested by the page.
- New option
NoDefaultsin BrowserType.ConnectOverCDPAsync() 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.
🛠️ Other improvements
- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.
Breaking Changes ⚠️
- Docker image bumped to .NET SDK 10; no more docker images are published for Ubuntu Jammy.
- Removed long-deprecated
Handleoption onBrowserContext.ExposeBindingAsyncandPage.ExposeBindingAsync.
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