Press a key
qa_pressDispatch keyboard keys such as Enter, Escape, and Tab to focused elements or selectors, then return page changes, actual focus, and live-region announcements for reliable browser automation.
Instructions
Dispatch a keyboard key (keydown/keypress/keyup) — Enter to submit, Escape to close, Tab to move focus. Without a selector it goes to whatever currently has focus, like a real keyboard. Like qa_click, it returns what changed once the page settled. On a recent extension build the reply also carries focus — the element that ACTUALLY holds focus after the key (name, role, selector, box), which is how you follow a Tab route or catch focus landing somewhere unnamed — and announced, what the live regions spoke (null = they stayed silent). Requires the one-time “Agent control” confirmation in the panel; without it the extension answers consent-required and does nothing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>"
},
"name": "qa_press"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key value, e.g. "Enter", "Escape", "Tab", "a" | |
| ref | No | Optional target (a qa_snapshot ref); defaults to the focused element | |
| tabId | No | Target tab (from qa_tabs); omit for the active tab | |
| frameId | No | Which frame to ask, from qa_frames. Omit for the page itself. A payment form, an SSO step or an embedded widget usually lives in a frame of its own, and a cross-origin one can only be read from inside it. | |
| selector | No | Optional target (CSS); defaults to the focused element |