docs(trace-viewer-intro): fix code snippet for C# (#22648)
This commit is contained in:
parent
f3852d4511
commit
b7656e605a
|
|
@ -62,24 +62,24 @@ context.tracing.stop(path = "trace.zip")
|
||||||
```
|
```
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
await using var browser = playwright.Chromium.LaunchAsync();
|
await using var browser = await Playwright.Chromium.LaunchAsync();
|
||||||
await using var context = await browser.NewContextAsync();
|
await using var context = await browser.NewContextAsync();
|
||||||
|
|
||||||
// Start tracing before creating / navigating a page.
|
// Start tracing before creating / navigating a page.
|
||||||
await context.Tracing.StartAsync(new()
|
await context.Tracing.StartAsync(new()
|
||||||
{
|
{
|
||||||
Screenshots = true,
|
Screenshots = true,
|
||||||
Snapshots = true,
|
Snapshots = true,
|
||||||
Sources = true
|
Sources = true
|
||||||
});
|
});
|
||||||
|
|
||||||
var page = context.NewPageAsync();
|
var page = await context.NewPageAsync();
|
||||||
await page.GotoAsync("https://playwright.dev");
|
await page.GotoAsync("https://playwright.dev");
|
||||||
|
|
||||||
// Stop tracing and export it into a zip archive.
|
// Stop tracing and export it into a zip archive.
|
||||||
await context.Tracing.StopAsync(new()
|
await context.Tracing.StopAsync(new()
|
||||||
{
|
{
|
||||||
Path = "trace.zip"
|
Path = "trace.zip"
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue