Blog · Grip

Browser automation when the UI changes: refresh the target before acting

· DOSAYGO

A ref identifies a control in an observed page state. It is not a durable promise that the same number will mean the same thing after a dialog opens, a page navigates, or a list redraws. Reusing an old ref can send an agent to the wrong place; retrying a timed-out submit can create a duplicate operation.

Selector-based frameworks such as Playwright, Puppeteer, and Selenium work well for stable apps and test suites with owned locators. Driving changing third-party UIs benefits from observing numbered refs on the live page. In Grip, refs are bound to the current (tab, frame) context and reset after page-state changes. For a detached click ref, Grip can re-resolve it only when it verifies the original document and a unique matching target, and it fails closed when evidence is incomplete rather than clicking a different node.

Use a short observation loop. Look at the current page, select the intended control using its label and context, act once, and inspect the resulting page before choosing the next action. If the target is missing or ambiguous, stop and investigate rather than guessing.

A concrete loop

Grip's HUD returns numbered actions. In this example the number is a placeholder, not a ref to copy into another session:

gripui hud
gripui do 3
gripui hud
gripui read

Select the current number from the first HUD, then get a fresh HUD after the action. When two controls share a label, use the surrounding context to decide whether either is the intended one. For a missing control, the Grip docs recommend checking the active layer, scrolling, listing frames, and switching into the frame that holds the control (f1 below is an example frame label from gripui frame list) before looking again:

gripui hud --layer active
gripui scroll down
gripui frame list
gripui frame switch f1
gripui hud

If a form field rejects input after you find it, run gripui doctor <ref> to inspect its live value, declared constraints, and validation message (replacing <ref> with the field's current number). Do not blindly replay a timed-out write. Inspect the page and, where available, the record or confirmation created by the site first. If the outcome remains uncertain, send it for human review. A visible field value is also not proof that the server saved it; check the application's resulting state.

Grip drives a local Chrome or Firefox browser and gives the agent structured page state and actions. Fresh observations reduce reliance on old targets, but they cannot guarantee that a changed interface means the same thing or that a site accepted a submission. The agent still needs a task boundary, and a human should review consequential changes. Browser actions require a paid license: Solo Dev is $79 per year for one developer's local work on up to two machines, and Pro Runner is $499 per year for headless, CI, and production workflows on up to three machines or runners at a time. Both renew annually until cancelled and are refundable within two days of activation or of a renewal charge; AI-provider charges are separate.

See Grip pricing

← All posts