

























@@ -213,14 +213,14 @@ openclaw browser set device "iPhone 14"
213213Notes:
214214215215- `upload` and `dialog` are **arming** calls; run them before the click/press that triggers the chooser/dialog.
216-- `click`/`type`/etc require a `ref` from `snapshot` (numeric `12` or role ref `e12`). CSS selectors are intentionally not supported for actions. Use `click-coords` when the visible viewport position is the only reliable target.
216+- `click`/`type`/etc require a `ref` from `snapshot` (numeric `12`, role ref `e12`, or actionable ARIA ref `ax12`). CSS selectors are intentionally not supported for actions. Use `click-coords` when the visible viewport position is the only reliable target.
217217- Download, trace, and upload paths are constrained to OpenClaw temp roots: `/tmp/openclaw{,/downloads,/uploads}` (fallback: `${os.tmpdir()}/openclaw/...`).
218218- `upload` can also set file inputs directly via `--input-ref` or `--element`.
219219220220Snapshot flags at a glance:
221221222222- `--format ai` (default with Playwright): AI snapshot with numeric refs (`aria-ref="<n>"`).
223-- `--format aria`: accessibility tree, no refs; inspection only.
223+- `--format aria`: accessibility tree with `axN` refs. When Playwright is available, OpenClaw binds refs with backend DOM ids to the live page so follow-up actions can use them; otherwise treat the output as inspection-only.
224224- `--efficient` (or `--mode efficient`): compact role snapshot preset. Set `browser.snapshotDefaults.mode: "efficient"` to make this the default (see [Gateway configuration](/gateway/configuration-reference#browser)).
225225- `--interactive`, `--compact`, `--depth`, `--selector` force a role snapshot with `ref=e12` refs. `--frame "<iframe>"` scopes role snapshots to an iframe.
226226- `--labels` adds a viewport-only screenshot with overlayed ref labels (prints `MEDIA:<path>`).
@@ -243,10 +243,21 @@ OpenClaw supports two “snapshot” styles:
243243 - Add `--urls` when link text is ambiguous and the agent needs concrete
244244 navigation targets.
245245246+- **ARIA snapshot (ARIA refs like `ax12`)**: `openclaw browser snapshot --format aria`
247+ - Output: the accessibility tree as structured nodes.
248+ - Actions: `openclaw browser click ax12` works when the snapshot path can bind
249+ the ref through Playwright and Chrome backend DOM ids.
250+ - If Playwright is unavailable, ARIA snapshots can still be useful for
251+ inspection, but refs may not be actionable. Re-snapshot with `--format ai`
252+ or `--interactive` when you need action refs.
253+246254Ref behavior:
247255248256- Refs are **not stable across navigations**; if something fails, re-run `snapshot` and use a fresh ref.
249257- If the role snapshot was taken with `--frame`, role refs are scoped to that iframe until the next role snapshot.
258+- Unknown or stale `axN` refs fail fast instead of falling through to
259+ Playwright's `aria-ref` selector. Run a fresh snapshot on the same tab when
260+ that happens.
250261251262## Wait power-ups
252263此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。