Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(dotnet): add API to run CLI commands (#11641)

Max Schmitt97b975b5ec8f
diff --git a/docs/src/intro-csharp.md b/docs/src/intro-csharp.md
index 4544e248cf..b8f4542716 100644
--- a/docs/src/intro-csharp.md
+++ b/docs/src/intro-csharp.md
@@ -122,6 +122,18 @@ dotnet test -- NUnit.NumberOfTestWorkers=5
pwsh bin\Debug\netX\playwright.ps1 codegen
```
+## Install browsers via API
+
+It's possible to run [Command line tools](./cli.md) commands via the .NET API:
+
+```csharp
+var exitCode = Microsoft.Playwright.Program.Main(new[] {"install"});
+if (exitCode != 0)
+{
+ throw new Exception($"Playwright exited with code {exitCode}");
+}
+```
+
## System requirements
The browser binaries for Chromium, Firefox and WebKit work across the 3 platforms (Windows, macOS, Linux):