Press key
browser_press_keyPresses a keyboard key in a live browser session, optionally targeting a specific element via CSS selector or accessible name, using Playwright-compatible key names.
Instructions
Presses a key, optionally focused on an element. Key names follow Playwright ("Enter", "Escape", "ArrowDown", "Control+a").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | CSS selector, as an alternative to ref. | |
| key | Yes | ||
| ref | No | Element ref from the most recent snapshot, e.g. "e12". Preferred — refs are exact. Only valid for the page state that produced them. | |
| name | No | Accessible name to match alongside role. | |
| role | No | ARIA role, e.g. "button". Combine with name for an accessible-name match. | |
| index | No | Which match to use when the selector is ambiguous (0-based, default 0). | |
| sessionId | Yes | Session id returned by browser_start. |