Key Press
Key Press
Section titled “Key Press”Type: page-key-press · Package: Browser v1.0.9
Sends a key or a combination to the page, such as Enter, Tab, Escape, F5 or shortcuts like Control+a. Useful to submit forms with Enter, move between fields with Tab, close dialogs with Escape or trigger the application’s keyboard shortcuts.
How it works
Section titled “How it works”If you set a selector, it first waits for the element to exist (up to timeout), focuses it and then sends the key(s). If you omit it, the key goes to the page (to whichever element has focus), right away. Keys use Playwright names (see table), and combinations are joined with +: the modifiers are held down and the last key is pressed.
Before sending them, the activity normalizes the names case-insensitively, so you can write shortcuts naturally:
| You write | It sends |
|---|---|
ctrl, control | Control |
alt · shift | Alt · Shift |
win, meta | Meta |
enter, return | Enter |
esc, escape | Escape |
del, delete · ins, insert | Delete · Insert |
pgup, pageup · pgdn, pagedown | PageUp · PageDown |
left, right, up, down | ArrowLeft, ArrowRight, ArrowUp, ArrowDown |
tab, space, backspace, home, end, f1…f12 | Tab, Space, Backspace, Home, End, F1…F12 |
A single letter (A) | Lowercase (a) |
Any other name is sent as-is. To write text use Type Text or Fill Field: this activity is for single keys and shortcuts.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
keys | string | — | Key or combination. E.g. Tab, Enter, Escape, F5, Control+a, Shift+Tab, Control+Shift+i. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page | ZoanPageSession | — | The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page). |
selector | selector | — | Element to focus before sending the key. If omitted, it goes to the page. |
timeout | number | 30000 | Maximum time in ms to wait for the element (only with selector). Empty, 0 or negative: the project settings value or, if none, 30000. |
Common key names
Section titled “Common key names”| Key | keys |
|---|---|
| Enter | Enter |
| Tab | Tab |
| Escape | Escape |
| Arrows | ArrowDown, ArrowUp, ArrowLeft, ArrowRight |
| Function keys | F1 … F12 |
| Select all | Control+a |
| Reverse tab | Shift+Tab |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Search and confirm with Enter:
Page Fill selector = (#buscar) value = "invoice 2026"Page Key Press selector = (#buscar) keys = "Enter"Page Wait For selector = (.resultados) state = visibleCommon errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'keys' is required. | keys is empty. |
Unknown key: "…" | The key name doesn’t exist. Use the names in the tables on this page or check the spelling. |
Timeout 30000ms exceeded | With selector, the element didn’t appear in time. Check the selector or wait first with Wait For. |
'page' must be a ZoanPageSession. | page is empty outside a body. |