Skip to content

Commit 6af2648

Browse files
committed
docs(selectors): split the find focus rule and name the covered refusal
Refs callstack#3734
1 parent 5f179ae commit 6af2648

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎website/docs/docs/selectors.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ Tips:
5555
- Use `find ... wait <timeoutMs>` to wait for an element to appear.
5656
- Pair `find` with a scoped snapshot (`snapshot -s "<label>"`) for speed.
5757
- [Android] If the matched node is not hittable, agent-device clicks or focuses the nearest hittable ancestor.
58-
- `find ... focus` and `find ... type` aim at a text field: the match or the field holding it, even when it is not hittable or sits beside other fields, or else the one enabled on-screen field inside the match. Several fields inside the match refuse with `AMBIGUOUS_MATCH` and the field candidates, and a disabled field refuses with `COMMAND_FAILED` and reason `target_disabled`. Web text boxes are not recognized as text fields, so a web match keeps its own aim.
58+
- `find ... focus` and `find ... type` aim at a text field. If the match is a field or sits inside one, that field is the target, even when it is not hittable or has other fields beside it. Otherwise the target is the one enabled on-screen field inside the match.
59+
- Several fields inside the match refuse with `AMBIGUOUS_MATCH` and the field candidates.
60+
- A disabled field refuses with `COMMAND_FAILED` and reason `target_disabled`.
61+
- A match or field covered by another visible element refuses with `COMMAND_FAILED`.
62+
- Web text boxes are not recognized as text fields, so a web match keeps its own aim.
5963
- Use `fill` to find a field and replace its text in one step. To append to the text in the focused field, use `click` or `press`, then `type`.
6064

6165
## Selector syntax

0 commit comments

Comments
 (0)