Key Press
Key Press
Section titled “Key Press”Type: page-key-press · Package: Browser v1.0.0
Sends a key or combination to the page, such as Enter, Tab, Escape, F5, or shortcuts such as Control+a. Useful for confirming forms with Enter, moving between fields with Tab, closing dialogs with Escape or triggering application keyboard shortcuts.
How it works
Section titled “How it works”If you indicate a selector, first focus that element and then send the key(s). If you omit it, the key is sent to the page (to the element with focus). The keys use the Playwright names (see examples), and the combinations join with +.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
keys | expression | Key or combination. Ex: Tab, Enter, Escape, F5, Control+a, Shift+Tab, Control+Shift+i. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
page | session | The page session. Omit it inside a body; outside, pass = page. |
selector | selector | Element to focus before sending the key. If skipped, goes to page. |
timeout | number | Maximum ms to wait for the element (when there is a selector). By default 30000. |
Nombres de teclas comunes
Section titled “Nombres de teclas comunes”| Tecla | keys |
|---|---|
| Enter / Intro | Enter |
| Tabulador | Tab |
| Escape | Escape |
| Flechas | ArrowDown, ArrowUp, ArrowLeft, ArrowRight |
| Funciones | F1 … F12 |
| Seleccionar todo | Control+a |
| Tab inverso | Shift+Tab |
Example
Section titled “Example”Search and confirm with Enter:
Page Fill selector = (#buscar) value = "factura 2026"Page Key Press selector = (#buscar) keys = "Enter"