Docs/SDK/Tabs

Tabs

Manage multi-tab workflows safely (open, switch, list, close) without dropping to backend-specific APIs.

This page covers:

Tab control keeps multi-page workflows deterministic.

Instead of letting the browser open new tabs implicitly, manage them explicitly so each step has a known active page.

Table of Contents

  1. Runtime methods
  2. Example: open → switch → verify → close

Runtime methods

Tab APIs are currently available in Python AgentRuntime.

MethodPurpose
list_tabs()List open tabs and their ids.
open_tab(url)Open a new tab to a URL.
switch_tab(tab_id)Switch active tab by id.
close_tab(tab_id)Close a tab by id.

Example: open → switch → verify → close

tabs = await runtime.list_tabs()
opened = await runtime.open_tab("https://example.com")

await runtime.switch_tab(opened.tab.tab_id)
await runtime.snapshot(limit=60)
runtime.assert_(url_contains("example.com"), "on_target", required=True)

await runtime.close_tab(opened.tab.tab_id)