List all active browser sessions
()
| 44 | |
| 45 | |
| 46 | def list_sessions() -> None: |
| 47 | """List all active browser sessions""" |
| 48 | try: |
| 49 | response = make_request("GET", "/browser_sessions") |
| 50 | sessions = response.json() |
| 51 | print("\nActive browser sessions:") |
| 52 | if not sessions: |
| 53 | print(" No active sessions found") |
| 54 | return |
| 55 | for session in sessions: |
| 56 | try: |
| 57 | print(json.dumps(session, indent=2)) |
| 58 | print(" ---") |
| 59 | except Exception as e: |
| 60 | print(f" Error parsing session data: {session}") |
| 61 | print(f" Error: {str(e)}") |
| 62 | except Exception as e: |
| 63 | print(f"Error listing sessions: {str(e)}") |
| 64 | |
| 65 | |
| 66 | def create_browser_session() -> Optional[str]: |
no test coverage detected