Automation: navigation and reading the page
Commands that open addresses, capture the page structure, wait for conditions and export content.
The commands below act on the active browser tab. Commands, flags and values are literal — they are not translated.
How to choose the target
| Flag | Target |
|---|---|
--page <id> |
A specific page, by its global identifier |
--node <card> |
The tab referenced by a Canvas card |
--workspace <selector> |
The workspace |
--pageand--nodetogether are an error.- Without any of the three, the target is the active tab of the current directory’s workspace.
- A card resolves the card’s workspace, not the one from the directory you called from.
Navigate
elyra goto --url <url> [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra back [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra forward [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra reload [--page <id> | --node <card>] [--workspace <selector>] [--json]gotorequires--url.gotoandreloadwait for the network to go idle, with a 60 s timeout on the call.- The response brings the resulting URL and title;
backandforwardbring the destination URL. gotoaccepts anyhttp(s)URL or file — it is the entry point for external content into the embedded browser.
Read the page
elyra snapshot [--page <id> | --node <card>] [--workspace <selector>] [--json]snapshot returns the active tab’s accessibility tree. It is the source of the refs used by --element in the interaction commands.
A
refbecomes stale after navigating. The CLI itself recommends taking a new snapshot after acting, to check what settled.
Capture image and PDF
elyra screenshot [--format <png|jpeg>] [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra full-screenshot [--format <png|jpeg>] [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra pdf [--page <id> | --node <card>] [--workspace <selector>] [--json]screenshotcaptures the viewport;full-screenshotcaptures the whole page.--formatacceptspngorjpeg. Any other value is refused — includingwebp.full-screenshotnormalizes any format other thanjpegtopng.pdfexports the tab and reports the size of the generated content. Large PDFs travel as base64 in the response.
Scroll
elyra scroll --direction <up|down> [--amount <pixels>] [--page <id> | --node <card>] [--workspace <selector>] [--json]--direction is required and accepts only up or down; another value fails with an argument error. --amount is optional.
Wait
elyra wait [--selector <sel>] [--text <text>] [--url <pattern>] [--load <state>] [--fn <js>] [--state <hidden|visible>] [--timeout <ms>] [--page <id> | --node <card>] [--workspace <selector>] [--json]Accepted wait forms: element by selector, text, URL pattern, load state, JavaScript condition and visibility (hidden or visible).
- The default call timeout is 60 s; when you pass
--timeout, the budget becomes the given value plus 5 s. - A long wait without
--timeoutcan blow the caller’s budget.
Run code on the page
elyra eval --expression <js> [--page <id> | --node <card>] [--workspace <selector>] [--json]elyra exec --command "<agent-browser command>" [--page <id> | --node <card>] [--workspace <selector>] [--json]evalrequires--expressionand returns the expression’s result.execpasses a raw command to the active tab’s browser and returns the raw output.execis not validated by the CLI beyond requiring--command.
evalandexecrun arbitrary code in the page context — full power over the tab, including whatever is logged in on it. Use them only on pages and profiles you accept exposing, and never on a profile with a real session without need.