From 8ee2393105a9e92d540bfb55f0e24136a5231140 Mon Sep 17 00:00:00 2001 From: Anand M Cherian <63868951+Anand-M-Cherian@users.noreply.github.com> Date: Tue, 15 Oct 2024 22:51:15 +0530 Subject: [PATCH] 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. As per the suggestion in the review comment, instead of "any one of the alternatives" it was decided to go ahead with "any one or both of the alternatives" to be as clear and explicit as possible. Co-authored-by: Dmitry Gozman Signed-off-by: Anand M Cherian <63868951+Anand-M-Cherian@users.noreply.github.com> --- docs/src/locators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/locators.md b/docs/src/locators.md index 3075d2410c..648a654177 100644 --- a/docs/src/locators.md +++ b/docs/src/locators.md @@ -1218,7 +1218,7 @@ var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle("Subscribe")); ### 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 any one 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 or both 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.