Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(selectors): avoid nth, first, last (#16028)

Ross Wollman5a91623fae42
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