Press keys in the page
Sends key events to the focused element or to an element.
Press keys in the page
Details #
keys is one or more keys, like Enter, Tab, Escape, cmd+a, shift+Tab or a, separated by spaces. Typing a letter into a field inserts it. Some sites ignore keys a script sends; the pressKeys step sends real ones.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
keys | text | Yes | Required. | |
browser | one of | safari chrome front | ||
selector | text | Send them to this element. | ||
tab | any value | |||
timeout | number | , tab. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
Submit with Enter
Do
- Press “Enter” in the page
Gotchas #
Synthetic keys are not trusted keys; a site can tell.