Session Termination
Browser sessions can end in these ways:- Automatic Timeout Sessions have a default timeout configured at the project level, which can be customized when creating a session. For longer-running tasks, enable keep alive.
-
Manual Termination
You can end sessions explicitly by closing the browser programmatically (
browser.close()ordriver.quit()), using the Sessions API, or releasing keep-alive sessions when no longer needed. - Unhandled Errors Unhandled errors in your automation code can cause your script to disconnect from the browser, ending the session prematurely. Common scenarios include network interruptions, uncaught exceptions, or exceeded resource limits. To prevent premature termination, make sure to implement proper error handling and cleanup in your code.
-
CDP Inactivity Timeout
CDP (Chrome DevTools Protocol) connections are closed after 10 minutes without any CDP commands. If your script holds a session open without sending CDP commands for this period, the connection will be terminated.
To keep the connection alive, send a periodic heartbeat — a lightweight CDP command at a regular interval:
Session Timeout Settings
Configure timeouts at two levels: Project Level Set the default timeout for all sessions in your project settings. This acts as the fallback when no session-specific timeout is set. Session Level Override the project timeout for specific sessions when creating them. This gives you fine-grained control over individual session durations.Debugging Completed Sessions
The Session Inspector is your primary tool for analyzing completed sessions. It provides comprehensive debugging capabilities:Session Replay
Record and replay browser activity to understand what happened
Network Monitor
Inspect HTTP traffic, responses, and timing
Console & Logs
Review JavaScript output and debug messages
Performance
Track CPU, memory usage, and other metrics