-
Notifications
You must be signed in to change notification settings - Fork 0
frame
Move into an iframe, or back out of it.
| MCP tool | frame |
| HTTP | POST /browser/frame |
action is one of: switch, parent, default. Use switch with an xpath (or index) to go into a frame, parent to go up one level, and default to return to the main page.
Selenium does not look inside frames: an element in one is invisible to every locator until you switch in. The switch sticks — every later call stays in that frame until you switch back, so if a locator that should work is failing, check session://current for in_frame.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
action |
string | no | switch |
|
xpath |
string | no | — | |
index |
integer | no | — | |
session_id |
string | yes over HTTP | — | The session_id returned by /browser/open. Required here. |
wait_timeout |
integer | no | 30 |
| Field | Type | Notes |
|---|---|---|
action |
string | The switch that was performed. |
in_frame |
boolean | Whether the session is now inside a frame. |
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
frame()
HTTP
curl -X POST $SELENIUM_FLOW/browser/frame \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"session_id": "…"
}'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