Silent Coordinate Mismatch Can Cause All Browser Automation Clicks to Miss Target
A developer running an AI browser automation agent to list a product across four marketplaces discovered that clicks were silently landing in the wrong locations with no errors or logs. The root cause was a mismatch between screenshot pixel space and CSS pixel space — when the screenshot resolution differed from the viewport width, every DOM-derived coordinate was off by a constant factor. In this case, a 1702 CSS-pixel-wide viewport was captured in screenshots at roughly 1274 pixels, producing a scaling factor of approximately 0.748. The developer identified the bug by injecting a test button at a known position and confirming that click events were never actually arriving at their intended target. Applying a single coordinate conversion function using the measured scaling factor immediately resolved all previously failing interactions, including dropdowns, menus, and confirmation dialogs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in