From 5a91623fae42740a6a6b14e99bf3143a92ffd98b Mon Sep 17 00:00:00 2001 From: Ross Wollman Date: Thu, 28 Jul 2022 13:17:18 -0700 Subject: [PATCH] docs(selectors): avoid nth, first, last (#16028) --- docs/src/selectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/selectors.md b/docs/src/selectors.md index 9b2c74abe3..508b54f2af 100644 --- a/docs/src/selectors.md +++ b/docs/src/selectors.md @@ -1323,7 +1323,7 @@ await page.Locator("data-test-id=directions").ClickAsync(); ### Avoid selectors tied to implementation [xpath] and [css] can be tied to the DOM structure or implementation. These selectors can break when -the DOM structure changes. +the DOM structure changes. Similarly, [`method: Locator.nth`], [`method: Locator.first`], and [`method: Locator.last`] are tied to implementation and the structure of the DOM, and will target the incorrect element if the DOM changes. ```js // avoid long css or xpath chains