Press key
press_keySend key presses and keyboard chords to a target or currently focused element to enable keyboard navigation, form submission, dialog dismissal, and keyboard-only accessibility testing.
Instructions
Presses a key or chord (Enter, Tab, Escape, arrows, Space, Shift+Tab, Control+A, ...) in the session page. With a target, focuses that element and sends the key to it; without one, sends the key to the currently focused element. Use it for keyboard navigation, submitting a form with Enter, closing a dialog with Escape, or exercising keyboard-only interactions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key or chord to press, using Playwright key names: "Enter", "Tab", "Escape", "ArrowDown", "Space", "Shift+Tab", "Control+A", "Meta+Enter", "F1", "Backspace", "PageDown". To type a literal character use "type" instead. | |
| target | No | Optional element to focus first and send the key to (Playwright locator.press). Omit to send the key to the page's currently focused element (page.keyboard.press). | |
| sessionId | Yes | Session id returned by start_session. Required on every stateful tool call. | |
| timeoutMs | No | Action timeout in milliseconds when a target is given (default 10000). |