github microsoft/playwright-dotnet v1.65.0

56 minutes ago

🧾 Locator code in C#

A locator from Locator.NormalizeAsync() now converts to a string as C# code. Use it with Page.GetByRef() to turn an element that an agent picks from a Page.AriaSnapshotAsync() in the "ai" mode into code for your test:

var normalized = await page.GetByRef("e2").NormalizeAsync();
Console.WriteLine(normalized.ToString());
// GetByRole(AriaRole.Button, new() { Name = "Submit" })

New APIs

  • New option Timeout in CDPSession.SendAsync().

  • New PlaywrightAssertionException is thrown when a Playwright assertion is not met. It extends PlaywrightException, so catch (PlaywrightException) blocks catch it as well.

  • New ActionTimeout and NavigationTimeout run settings set the default timeouts of every context that the NUnit, MSTest, xUnit and xUnit v3 base classes create. Set them in the .runsettings file or on the command line:

    <RunSettings>
      <Playwright>
        <ActionTimeout>10000</ActionTimeout>
        <NavigationTimeout>60000</NavigationTimeout>
      </Playwright>
    </RunSettings>
    dotnet test -- Playwright.ActionTimeout=10000 Playwright.NavigationTimeout=60000

Breaking Changes ⚠️

Announcements

  • ⚠️ Playwright for .NET now bundles Node.js 26 instead of Node.js 24. On Linux, Node.js 26 needs the libatomic1 library.

Browser Versions

  • Chromium 158.0.8127.18
  • Mozilla Firefox 159.0
  • WebKit 27.2

This version was also tested against the following stable channels:

  • Google Chrome 157
  • Microsoft Edge 156

Don't miss a new playwright-dotnet release

NewReleases is sending notifications on new releases.