Skip to content

Commit

Permalink
docs: add reference to locator strictness if or resolves to multiple …
Browse files Browse the repository at this point in the history
…elements (#32633)
  • Loading branch information
mxschmitt committed Sep 16, 2024
1 parent feac957 commit b335b00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,9 @@ var banana = await page.GetByRole(AriaRole.Listitem).Nth(2);
- alias-python: or_
- returns: <[Locator]>

Creates a locator that matches either of the two locators.
Creates a locator matching all elements that match one or both of the two locators.

Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.md#strictness) guidelines.

**Usage**

Expand Down
5 changes: 4 additions & 1 deletion packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13060,7 +13060,10 @@ export interface Locator {
nth(index: number): Locator;

/**
* Creates a locator that matches either of the two locators.
* Creates a locator matching all elements that match one or both of the two locators.
*
* Note that when both locators match something, the resulting locator will have multiple matches and violate
* [locator strictness](https://playwright.dev/docs/locators#strictness) guidelines.
*
* **Usage**
*
Expand Down

0 comments on commit b335b00

Please sign in to comment.