Update docs/src/locators.md

The section for "Matching one of the two alternative locators" mentioned "matching all of the alternatives". However, since we are using or() operator, it should match "any one of the alternatives" to locate the element.

Signed-off-by: Anand M Cherian <63868951+Anand-M-Cherian@users.noreply.github.com>
This commit is contained in:
Anand M Cherian 2024-10-13 11:44:36 +05:30 committed by GitHub
parent 699f51b227
commit 87be9f5929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1218,7 +1218,7 @@ var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle("Subscribe"));
### Matching one of the two alternative locators ### Matching one of the two alternative locators
If you'd like to target one of the two or more elements, and you don't know which one it will be, use [`method: Locator.or`] to create a locator that matches all of the alternatives. If you'd like to target one of the two or more elements, and you don't know which one it will be, use [`method: Locator.or`] to create a locator that matches any one of the alternatives.
For example, consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly. For example, consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.