Skip to content

Automation: navigation and reading the page

Commands that open addresses, capture the page structure, wait for conditions and export content.

View Markdown

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
  • --page and --node together 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.
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]
  • goto requires --url.
  • goto and reload wait for the network to go idle, with a 60 s timeout on the call.
  • The response brings the resulting URL and title; back and forward bring the destination URL.
  • goto accepts any http(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 ref becomes 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]
  • screenshot captures the viewport; full-screenshot captures the whole page.
  • --format accepts png or jpeg. Any other value is refused — including webp.
  • full-screenshot normalizes any format other than jpeg to png.
  • pdf exports 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 --timeout can 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]
  • eval requires --expression and returns the expression’s result.
  • exec passes a raw command to the active tab’s browser and returns the raw output.
  • exec is not validated by the CLI beyond requiring --command.

eval and exec run 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.