Back to directory
microsoft avatar
microsoft / playwright-dotnet

playwright-dotnet

.NET version of the Playwright testing and automation library.

2,999

Stars

302

Forks

55

Watchers

MIT

License

Playwright for .NET 🎭

NuGet version Join Discord

Linux macOS Windows
Chromium 151.0.7922.34
WebKit 26.5
Firefox 153.0

Playwright for .NET is the official language port of Playwright, the library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.

Documentation

https://playwright.dev/dotnet/docs/intro

API Reference

https://playwright.dev/dotnet/docs/api/class-playwright

using System.Threading.Tasks;
using Microsoft.Playwright;

using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync(new() { Headless = false });
var page = await browser.NewPageAsync();
await page.GotoAsync("https://playwright.dev/dotnet");
await page.ScreenshotAsync(new() { Path = "screenshot.png" });

Other languages

More comfortable in another programming language? Playwright is also available in

Releases

🔑 WebAuthn passkeys New Credentials virtual authenticator, available via BrowserContext.Credentials, lets tests register passkeys and answer navigator.credentials.create() / navigator.credentials.get...

💬 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 log...

🎬 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 rece...

Trace Viewer Improvements

New 'system' theme option follows your OS dark/light mode preference Search functionality (Cmd/Ctrl+F) is now available in code editors Network details panel has been reorga...

Chrome for Testing Starting with this release, Playwright switches from Chromium, to using Chrome for Testing builds. Both headed and headless browsers are subject to this. Your tests should still be...