diff --git a/docs/src/locators.md b/docs/src/locators.md index b1e8b778c8..76d1ba4073 100644 --- a/docs/src/locators.md +++ b/docs/src/locators.md @@ -989,7 +989,7 @@ Note that the inner locator is matched starting from the outer one, not from the You can chain methods that create a locator, like [`method: Page.getByText`] or [`method: Locator.getByRole`], to narrow down the search to a particular part of the page. -In this example we first create a locator called product by locating the test id. We then filter by text. We can use the product locator again to get by role of button and click it and then use an assertion to make sure there is only one product with the text "Product 2". +In this example we first create a locator called product by locating its role of `listitem`. We then filter by text. We can use the product locator again to get by role of button and click it and then use an assertion to make sure there is only one product with the text "Product 2". ```js const product = page.getByRole('listitem').filter({ hasText: 'Product 2' });