Back to directory
microsoft avatar

playwright-dotnet

.NET version of the Playwright testing and automation library.. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/microsoft/playwright-dotnet.git

3,004

Stars

301

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

🖼️ WebP screenshots page.screenshot() and locator.screenshot() can now capture screenshots in the WebP format — Playwright infers the format from a .webp file extension, or you can set the type explic...

🔑 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...