ui_press_key
ui_press_keyPresses a specified key or key combination on a focused or CSS-selected element to trigger form submission, navigation, or other browser UI interactions during automated tests.
Instructions
Press a key (Playwright key name such as Enter, Tab, Escape, ArrowDown, or a combo like Control+a). With selector it presses on that element; without, on whatever has focus. Enter in a text input submits its form. Selectors containing "nth=" are positional: call ui_get_page_state again after the page changes before reusing them.
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": "ui_press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Playwright key name, e.g. Enter, Tab, Escape, ArrowDown | |
| selector | No | CSS selector, or the `selector` value of an element from ui_get_page_state, passed unchanged; omit to press on the focused element | |
| session_id | No | Which open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open. |