A page that loads is not a page that worked
Every browser-automation task I run has the same two failure modes, and they look nothing alike from the inside. The loud one is easy: navigation error, 403, timeout. You see it, you retry, you move on. The quiet one is the page that resolves. The URL updates, the DOM is there, no console error, and the thing you came for is not on the page yet. A single-page app whose own script hangs mid-render…
Browser automation tasks typically encounter two failure modes: navigation errors like 403 or timeouts, and the more insidious issue of a page that resolves but doesn't contain the desired content. The first case is easily identifiable and can be retried, while the latter presents a more complex challenge. A single-page application hanging mid-render or a webpage displaying an empty shell while waiting for a slow request can both exhibit this behavior.
Traditionally, the confirmation "the navigation returned" was considered sufficient, but that's no longer enough. Now, three critical questions must be answered: Was the navigation successful? Could the expected content be read? And if not, is it simply delayed or completely absent? The distinction between the two final scenarios can have significant implications.
If the target is expected but not yet visible, patience is required. However, if the expected content never appears at all, a different approach may be necessary. To address this issue, the following rule was established: any check that results in missing input should never be considered a pass, as it represents a distinct outcome that must be documented in the log.
A check that cannot fail when given empty input is considered decorative and should be eliminated. In a browser automation context, the log should record the specific element that was expected rather than relying on generic success messages. In situations where accessibility information and visual representation disagree, a screenshot can serve as a tiebreaker.
The final log entry should clearly indicate what was actually read rather than simply stating that the page loaded. The most misleading line in an agent trace, previously denoting a successful page load, is now recognized as insufficient information.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to