Session Debugging & Replay
Browser Swarm offers comprehensive tools to debug and replay your browser automation sessions. By capturing detailed session data, you can analyze interactions, identify issues, and optimize your automation workflows.
๐ฅ Session Replay Overview
Every Browser Swarm session is automatically recorded, capturing a reconstruction of the Document Object Model (DOM) and user interactions. This replay is not a video but a dynamic reconstruction using rrweb events, allowing for in-depth inspection of session behavior.
๐ Inspecting Sessions with Session Inspector
The Session Inspector provides a suite of tools to analyze your sessions:
Timeline: Visualize the sequence of events and interactions during the session.
DOM View: Examine the HTML structure and changes over time.
Console Logs: Review logs emitted during the session, such as
console.log()
outputs.Network Events: Inspect HTTP requests and responses, including headers and payloads.
These tools enable you to pinpoint issues and understand session behavior in detail.
๐ฆ Retrieving Session Recordings
You can programmatically retrieve session recordings using the Browser Swarm SDK.
Example
These recordings contain the rrweb events needed to reconstruct the session for replay.
๐ฎ Integrating the Recording Player
To replay sessions within your application, you can integrate the rrweb player.
Using rrweb Player in JavaScript
This setup allows you to control playback, navigate through the session, and analyze specific interactions.
๐ผ๏ธ Embedding Replays via Iframe
For a simpler integration, you can embed the replay using an iframe:
Ensure that the /replay/${sessionId}
route serves a page initializing the rrweb player with the corresponding session events.
๐งช Working with Session Events
The rrweb player emits events that you can listen to for enhanced control:
These controls facilitate precise navigation and analysis of session recordings.
๐ Accessing Session Logs
Session logs provide detailed information about browser events, network requests, and other runtime data. You can retrieve these logs using the SDK:
Example
These logs are instrumental in diagnosing issues and understanding session behavior.
By leveraging Browser Swarm's session debugging and replay capabilities, you can gain deep insights into your automation workflows, swiftly identify issues, and enhance the reliability of your browser automation tasks.
Last updated