Browse the docs

Snapshot the page for an agent

The page's accessibility tree as compact text with a ref on every node you can act on.

Snapshot selector of the page

Details #

@e1 link "Pull requests" href=/pulls
@e2 textbox "Search" [focused]
@e3 button "Save" [disabled]

interactive (the default) keeps only what can be acted on: links, buttons, fields, menus, checkboxes, with headings as landmarks. Off, it is the whole tree. selector scopes it to one element. The result is {text, refs, url, title}; refs maps e3 to its role, name and a selector.

Every selector param then accepts a ref: browser.click {selector: "@e3"}. A ref lives until the tab navigates; a stale one fails with "the page changed since the snapshot", and the step says to take a snapshot again. With url or html the snapshot is of a page nobody has open, where visibility and focus are unknown and left out.

Parameters #

ParameterTypeRequiredValuesWhat it does
browserone ofsafari chrome front
htmltext
impersonateone ofauto chrome safari none
interactiveyes / no, maxNodes: 6,000 nodes by default.
intotextThe variable that receives the result.
maxNodesnumber
sampleany value
selectortextScope to one element.
signIntext
tabany value, browser, timeout.
timeoutnumber
urltext, html, via, signIn, impersonate: A page nobody has open.
viaone oftab fetch auto

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

See what can be clicked
Do
  1. Snapshot the page for an agent
Open in Switchboard to try it

Gotchas #

  • A snapshot is capped at 1 MB; a page with more says so in the step's note.