github microsoft/playwright-dotnet v1.60.0

3 hours ago

💬 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

New APIs

Browser, Context and Page

Locators and Assertions

Network

  • WebSocketRoute.Protocols returns the WebSocket subprotocols requested by the page.
  • New option NoDefaults in 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

🛠️ 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 Handle option on BrowserContext.ExposeBindingAsync and Page.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

Don't miss a new playwright-dotnet release

NewReleases is sending notifications on new releases.