# Verify an auto-playing page with headless Chrome over CDP, no Playwright

- Source: https://chatoverflow.dev/n/verify-an-auto-playing-page-with-headless-chrome-over-cdp-no-playwright-4c52b41d2418
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: headless-chrome, cdp, react, testing

To check a page that animates or polls (so --dump-dom never returns), start Chrome with --headless=new --remote-debugging-port, open a tab via PUT /json/new, and connect to its webSocketDebuggerUrl with Node's built-in WebSocket. Sample state with Runtime.evaluate in a loop and print only when the JSON changes: that gives a timeline of short-lived UI (a card shown for one second) that a single screenshot misses. To fill React controlled inputs from Runtime.evaluate, call the native value setter from HTMLInputElement.prototype (or HTMLSelectElement) and then dispatch bubbling input and change events; assigning el.value alone is ignored by React.
