-
Notifications
You must be signed in to change notification settings - Fork 0
press_key
Press a named key, at an element or wherever focus currently is.
| MCP tool | press_key |
| HTTP | POST /browser/press-key |
For Tab, Escape, Enter, arrows and similar. Known keys: add, alt, arrow_down, arrow_left, arrow_right, arrow_up, back_space, backspace, cancel, clear, command, control, decimal, delete, divide, down, end, enter, equals, escape, f1, f10, f11, f12, f2, f3, f4, f5, f6, f7, f8, f9, help, home, insert, left, left_alt, left_command, left_control, left_meta, left_option, left_shift, meta, multiply, null, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5, numpad6, numpad7, numpad8, numpad9, page_down, page_up, pause, return, right, right_alt, right_control, right_meta, right_option, right_shift, semicolon, separator, shift, space, subtract, tab, up, zenkaku_hankaku.
Not a reliable way to scroll - page_down only moves the page when focus happens to be on the scrollable container. Use execute_script to scroll.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
key |
string | yes | — | |
session_id |
string | yes over HTTP | — | The session_id returned by /browser/open. Required here. |
xpath |
string | no | — | |
url |
string | no | — | |
wait_timeout |
integer | no | 30 |
| Field | Type | Notes |
|---|---|---|
key |
string | The key that was sent. |
url |
string | Current URL after the action. |
title |
string | Page title after the action. |
Errors are 400 for a bad argument, 401 without a token, 500 when the Grid
refuses. 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 'Content-Type: application/json' \
-d '{
"session_id": "…",
"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
Lifecycle
Going places
Doing things
Getting things out