| Linux | macOS | Windows | |
|---|---|---|---|
| Chromium 138.0.7204.23 | ✅ | ✅ | ✅ |
| WebKit 18.5 | ✅ | ✅ | ✅ |
| Firefox 139.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.
https://playwright.dev/dotnet/docs/intro
https://playwright.dev/dotnet/docs/api/class-playwright
git fetch upstream main
git pull upstream main# 1. Update the version from `/playwright-dotnet/src/Common/Version.props` file
# 2. Delete the .drivers folder from `/playwright-dotnet/src/Playwright/.drivers`
# 3. Go to the root folder of the repo. And run the dotnet command to download the drivers again.
cd playwright-dotnet
dotnet run --project ./src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath .
# 4. Go to src and run build
cd src
dotnet build
# 5. Now publish a release for nuget.
dotnet pack -c Release
# dotnet pack -c Release /p:ApiCompatGenerateSuppressionFile=true
# 6. Push to Nuget registry
dotnet nuget push .\Playwright\bin\Release\WitcherPro.Playwright.<version>.nupkg -k <api-key-here> -s https://api.nuget.org/v3/index.jsonMake sure to log-in to your Docker account first.
cd ./utils/docker
.\publish_docker.ps1 -ReleaseChannel "stable" -DockerHubUsername "your_username"
# .\publish_docker.ps1 -ReleaseChannel "stable" -DockerHubUsername "kaljfeakjldghasioeg"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" });More comfortable in another programming language? Playwright is also available in
- TypeScript,
- Python,
- Java.