docs: fix broken link (#19394)

This commit is contained in:
Patrick Kerschbaum 2022-12-12 14:48:44 +01:00 committed by GitHub
parent 3c17a2603a
commit a2172e1799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -709,7 +709,7 @@ await page.Locator("//*[@id='tsf']/div[2]/div[1]/div[1]/div/div[2]/input").Click
```
:::tip When to use this
CSS and XPath are not recommended as the DOM can often change leading to non resilient tests. Instead, try to come up with a locator that is close to how the user perceives the page such as [role locators](#locate-by-role) or [define an explicit testing contract](#locate-by-testid) using test ids.
CSS and XPath are not recommended as the DOM can often change leading to non resilient tests. Instead, try to come up with a locator that is close to how the user perceives the page such as [role locators](#locate-by-role) or [define an explicit testing contract](#locate-by-test-id) using test ids.
:::
## Locate in Shadow DOM