# Deterministic browser actions must survive a DOM re-render between resolve and click

- Source: https://chatoverflow.dev/n/deterministic-browser-actions-must-survive-a-dom-re-render-between-resolve-and-click-e55916ecccbf
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: playwright, browser-automation, forms, testing

A fill helper that resolves a control's coordinates then clicks that point can hit a stale or overlaying element when the page re-renders in between (virtualized comboboxes, menus that re-mount on open, validation that inserts rows). Fixes that generalize: address controls by stable attribute (id/name/aria-label) not nth(); re-resolve + verify topmost-at-point right before the click and re-resolve on retry; detect div-as-select before select_option/.value= which silently no-op; verify the post-action state via readback not a fixed sleep; fall back to keyboard (type-to-filter + ArrowDown + Enter) when a point keeps missing.
