From 6968c83a8619122c89f8732eff4d20154c2b5c40 Mon Sep 17 00:00:00 2001 From: Super-Eric <9334019+Super-Eric@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:10:29 +0200 Subject: [PATCH] docs(csharp): fix nonexistent method names in guide examples `GetByText` is synchronous and returns a locator, while `Selectors.Register` and `Page.WaitForURL` are asynchronous and carry the `Async` suffix. The API reference already spells all three correctly. --- docs/src/extensibility.md | 2 +- docs/src/mock.md | 4 ++-- docs/src/navigations.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/extensibility.md b/docs/src/extensibility.md index ca423ca6ca2c8..e44b6214abdfa 100644 --- a/docs/src/extensibility.md +++ b/docs/src/extensibility.md @@ -155,7 +155,7 @@ button_count = page.locator("tag=button").count() ```csharp // Register the engine. Selectors will be prefixed with "tag=". // The script is evaluated in the page context. -await playwright.Selectors.Register("tag", new() { +await playwright.Selectors.RegisterAsync("tag", new() { Script = @" // Must evaluate to a selector engine instance. { diff --git a/docs/src/mock.md b/docs/src/mock.md index 9734e300d7a92..b5580b5c25245 100644 --- a/docs/src/mock.md +++ b/docs/src/mock.md @@ -76,7 +76,7 @@ await page.RouteAsync("*/**/api/v1/fruits", async route => { await page.GotoAsync("https://demo.playwright.dev/api-mocking"); // Assert that the Strawberry fruit is visible -await Expect(page.GetByTextAsync("Strawberry")).ToBeVisibleAsync(); +await Expect(page.GetByText("Strawberry")).ToBeVisibleAsync(); ``` ```java @@ -188,7 +188,7 @@ await page.RouteAsync("*/**/api/v1/fruits", async (route) => { await page.GotoAsync("https://demo.playwright.dev/api-mocking"); // Assert that the Loquat fruit is visible -await Expect(page.GetByTextAsync("Loquat", new () { Exact = true })).ToBeVisibleAsync(); +await Expect(page.GetByText("Loquat", new () { Exact = true })).ToBeVisibleAsync(); ``` ```java diff --git a/docs/src/navigations.md b/docs/src/navigations.md index 95c374a082785..b78065357cdea 100644 --- a/docs/src/navigations.md +++ b/docs/src/navigations.md @@ -147,7 +147,7 @@ page.wait_for_url("**/login") ```csharp await page.GetByText("Click me").ClickAsync(); -await page.WaitForURL("**/login"); +await page.WaitForURLAsync("**/login"); ``` ## Back/Forward Cache (BFCache)