Skip to main content

Observation

Commands for understanding what is on the page before interacting.

observe

AI-optimized page observation. Returns interactive elements with stable refs that you can pass to action commands.

Flags

flag
Return the full accessibility tree instead of just interactive elements.
flag
Return only form-related elements (textboxes, selects, checkboxes, etc.).
flag
Return only navigation elements (links, nav items).
number
default:"50"
Maximum number of elements to return.
flag
Incremental observation. Returns only changes since the last observation: elements added, updated, or removed.
string
default:"full"
Response tier controlling how much data is returned.

Response Tiers

Incremental Observation

After performing an action, use --diff to see only what changed instead of re-scanning the entire page:
The response includes changes: { added, updated, removed } — much smaller than a full observation.
Use --diff after small DOM changes (button clicks, form submissions). Use a full observe after navigation to a new page.

snapshot

Full YAML accessibility snapshot, compatible with playwright-cli.
The snapshot includes the full accessibility tree in YAML format. Useful for debugging and for playwright-cli compatibility.
bap observe is preferred over bap snapshot for AI agents. It returns structured data with stable refs instead of raw YAML.