A target description should identify the control by role or label and the surrounding record context, then demand a unique match. Coordinates and list positions are weak identifiers when banners, sorting, or responsive layout can move controls. A prompt may say 'the Change slot button inside appointment AP-684', but the browser driver must verify that exactly one matching control is present, visible, and usable at action time. After a navigation, validation message, or rerender, inspect state again. A handle captured earlier can point to an obsolete node, and an index can now refer to another appointment. If the target is ambiguous, stop and narrow the scope rather than forcing a click.
Browser target grounding: choose a unique control in the current state
Operational case
The portal lists AP-684 and AP-691, each with a 'Change slot' button. A sticky notice appears after the agent opens the first record, shifting the page. A coordinate memorized from the original screenshot now lands on AP-691. The safe action is grounded to the AP-684 row and its named button, with a uniqueness check against the current page. When the appointment list refreshes after a slot search, the agent re-reads the record ID and new button state. If two records share the same visible ID because of a rendering bug, it stops; the label is no longer enough to identify a safe target.
Target: appointment row whose visible ID is AP-684.
Within row: one enabled 'Change slot' control.
Before action: row count=1; control count=1; current page checked.
After rerender: discard old target and locate again.Performance and operating cost
Finding a record-scoped control is O(N) over N candidate rows in a simple page scan, with additional browser wait time for visibility and stable actionability. A positional shortcut is marginally cheaper but can select the wrong record after sorting. Cache stable business identifiers, not live element handles or screen coordinates. Timeouts should produce a reported ambiguity or unavailable-state outcome, not an unbounded click retry. The driver should expose target count and current state to the model; a prompt alone cannot prove that an element was actually clickable.
Common Mistakes
- Do not use the first matching button when multiple records have that button.
- Do not reuse a captured handle after a rerender.
- Do not bypass an ambiguous or obscured target with a forced click.
Connected lessons
- Prompt engineering applications
- Prompt Engineering
- Browser agents: separate observed state from intended action
- Tool catalogs: describe eligibility, inputs, and effects
- HTML labels: bind each control to a durable accessible name
- Browser forms: treat preview, submit, and server validation separately
- Web-page text is task data, not an agent instruction
- Browser effect recovery: resolve ambiguous submissions before retrying
- Project: reschedule an appointment through a browser safely
- Browser-agent prompt decisions
Continue with: Location prompts: resolve ambiguous addresses before routing.
