docs(other-locators.md): Improve grammar

Signed-off-by: damar Zaky <damzaky@gmail.com>
This commit is contained in:
damar Zaky 2024-07-14 14:50:55 +07:00 committed by GitHub
parent 11624e611f
commit 0c87235941
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -668,7 +668,7 @@ We recommend [locating by label text](./locators.md#locate-by-label) instead of
Targeted input actions in Playwright automatically distinguish between labels and controls, so you can target the label to perform an action on the associated control.
For example, consider the following DOM structure: `<label for="password">Password:</label><input id="password" type="password">`. You can target the label by it's "Password" text using [`method: Page.getByText`]. However, the following actions will be performed on the input instead of the label:
For example, consider the following DOM structure: `<label for="password">Password:</label><input id="password" type="password">`. You can target the label by its "Password" text using [`method: Page.getByText`]. However, the following actions will be performed on the input instead of the label:
- [`method: Locator.click`] will click the label and automatically focus the input field;
- [`method: Locator.fill`] will fill the input field;
- [`method: Locator.inputValue`] will return the value of the input field;