Skip to main content
All notes

Your test passed. Did the live data arrive?

A green end-to-end test says the price was on screen. It can't say the socket reconnected five times. Reading WebSocket messages behind a Playwright run.

Om Narayan
Om Narayan
Co-founder, RobusTest

19 November 2026 · FIELD · 5 min

Fig. 1

A stock price that ticks every second. A chat window. A live cricket score. None of that comes from a page load. It comes from a WebSocket that opens once and then carries small messages, hundreds or thousands of them, for as long as the page stays open.

It is also the part of the app our tests look at least.

An end-to-end test checks the screen. The price is visible, the message appeared, the score shows a number. Green. What the screen can't tell you:

  • the socket dropped and reconnected five times during the run;
  • the client sent its subscribe message twice, so the server sent everything twice;
  • the first price update arrived three seconds after the page loaded;
  • the server replied with an error frame and the UI ignored it.

Users notice every one of these. The test notices none. It is the same trap as "it returned OK": the check you ran passed, so you assume the thing you cared about worked too. And when one of them turns up in production, the first question anyone asks is what was actually on the wire.

The HAR file was never built for this

The standard answer to "what was on the wire" is a HAR file. You download it after the run and open it somewhere else.

For ordinary requests that is fine. For WebSockets it has been patchy for years. Chrome writes the messages into its HAR export under a field of its own, _webSocketMessages. Firefox has a bug asking for the same thing. It was filed in 2019 and it is still open. Playwright's own HAR recording only started including WebSockets with a change merged in June 2026.

So depending on which tool wrote your file, a socket that carried 1,500 messages can show up as a single line: the request that opened it. The conversation is missing.

And even when the messages are in the file, you are reading them in a different tool, on a different day, away from the test that produced them.

What we wanted was what a developer already has on their own laptop. Open the network list, click the socket, read the messages.

What it looks like now

Every session in RobusTest already recorded its network traffic. WebSockets are now part of that recording.

Sockets sit in the normal request list. Each one is a row among the page's other requests, in the order it opened, marked WS. There is a WS filter, the same way you would filter for XHR or images. The row shows how many messages went each way and how long the socket stayed open.

Click a socket and you get its messages. Every frame, with its direction, time and size. Sent and received have their own colours and their own filters. Click a message to see the whole thing. JSON is pretty-printed. Binary frames are shown as hex and base64, not as a line of unreadable bytes.

You can watch it live, and it is still there later. While the test runs, requests and messages show up as they happen. After the run, the same view opens on the finished session. That second part matters more than it sounds. Most failures get looked at the next morning, by someone who wasn't there.

The download is ordinary. It is a HAR file with the WebSocket messages in the same field Chrome DevTools uses. Import it into DevTools, attach it to a bug, feed it to your own scripts.

And because the lab sits on your premises, all of this stays there. Sockets carry the most sensitive things an app sends: prices, chats, session tokens. We have written before about what leaves your network when you test on someone else's cloud. A full transcript of your live feed is a good example of something that shouldn't.

Where it works

  • Playwright on real Android phones. Your test drives Chrome on a real device in the lab. Its traffic is recorded for the whole session.
  • Playwright on desktop browsers. Chromium and Firefox, including parallel workers. When several browsers run on one machine at once, each test's traffic stays with its own session.
  • Everything else on the lab's phones. The same network view covers manual sessions and Appium, Espresso, XCUITest and UI Automator runs.

Every test result links to its session's traffic. From a red test, or a suspiciously green one, the wire is one click away.

Nothing to add to your tests

There is no SDK, no listener and nothing to wrap around your test. The lab captures the traffic from outside the test, so the test itself doesn't change. Connect with the capabilities you already use, run the suite, open the result.

One exception. If you run Playwright with several workers, add one line so each result is matched to its own browser:

'robustest:worker': process.env.TEST_WORKER_INDEX

One run, read from the wire

Take a page with a live price feed. The test opens it, waits, and checks that a price is displayed. It passes.

Open the result's Network view and filter on WS. One socket. Its row says it sent 3 messages and received about 1,500 in under a minute. Open the messages. The first sent frame is the subscription request. The first received frame is a snapshot, and after that comes a steady stream of small JSON updates.

That is what working looks like, and it is worth knowing what it looks like. Because now you can tell when it doesn't. Two sockets where you expected one. A subscribe message sent twice. A ten-second hole in the received messages.

In each of those cases the screenshot at the end of the test is identical. The traffic isn't.

What we haven't covered

Traffic is half of it. On real Android phones the same Playwright session also records how Chrome itself behaved on the device during the run: CPU, memory, frame rendering, crashes. That needs its own post.

Sources
  1. 1 Playwright — feat(har): include WebSocket in .har (PR #41015) Merged 1 June 2026. Adds an entry for each WebSocket to Playwright's recorded HAR, with each sent/received frame in a custom _webSocketMessages property.
  2. 2 Mozilla Bugzilla 1575465 — Messages panel: WebSocket messages in HAR exports Still open. Asks for WebSocket messages to be included when Firefox exports a HAR; the proposed format is described as very similar to Chrome's _webSocketMessages.
  3. 3 Playwright docs — Parallelism Each worker's index is available as process.env.TEST_WORKER_INDEX and process.env.TEST_PARALLEL_INDEX.

Want to read your own app's sockets?

Bring a Playwright suite or a build to a demo session. Run it on real devices inside your own network, open the result, and read every request and every WebSocket message it produced.

Book a demo