-
Notifications
You must be signed in to change notification settings - Fork 0
press_key
Press a key or a combination, at an element (selector) or wherever focus already is.
| MCP tool | press_key |
| HTTP | POST /browser/press-key |
key is a name, a single character, or keys joined with +: Enter, Tab, Escape, ArrowLeft, PageDown, F5, Control+a, Shift+Tab. The browser's spelling (ArrowLeft) and Selenium's (arrow_left) both work, in any case.
Not a reliable way to scroll: PageDown moves the page only when focus is on the thing that scrolls. Use execute_script to scroll.
| Name | Type | Required | Default |
|---|---|---|---|
key |
string | yes | — |
selector |
Selector | no | — |
url |
string | no | — |
wait_timeout |
integer | no | 30 |
Every call names its session: an X-Session-Key header, or ?session=<name>.
Sending both is refused. See Sessions.
| Field | Type | Notes |
|---|---|---|
key |
string | The key that was sent. |
url |
string | Current URL after the action. |
title |
string | Page title after the action. |
| Status | Means |
|---|---|
400 |
The request cannot succeed as sent — a missing field, a value that was rejected, or a locator that matched nothing before the wait ran out. Do not retry it unchanged. |
401 |
Missing or wrong bearer token. |
404 |
No such browser session. It ended, the Grid reaped it, or the id was never real. Open a new one and retry. |
500 |
Something failed that this server did not expect. |
503 |
The Grid could not serve this — unreachable, or no free slot for a new browser. Worth retrying after a wait. |
Over MCP the same failures arrive as a tool error.
MCP
press_key(key="…")
HTTP
curl -X POST $SELENIUM_FLOW/browser/press-key \
-H "Authorization: Bearer $TOKEN" \
-H "X-Session-Key: $SESSION" \
-H 'Content-Type: application/json' \
-d '{
"key": "…"
}'The action pages are generated from openapi.yaml, which is itself generated from the live MCP tool schemas — so they describe the server that shipped, not the one someone remembered. Prose belongs in wiki-notes/<tool>.md in the repo.
selenium-flow · MIT
Start here
Guides
Lifecycle
Going places
Doing things
Getting things out