Playwright Browser
All Browser methods available when using the Playwright driver.
Access via runtime.browser after launching a Playwright runtime.
How these methods work over HTTP
Every method below is a remote call. The SDK translates it into a structured step sent to a single endpoint:
The call field maps directly to the method name. args is a JSON array of the method’s arguments. You can batch multiple steps in one request.
State Checks
isConnected()
Indicates that the browser is connected.
Note: This is async in the remote SDK, unlike the native Playwright API.
Returns boolean
Lifecycle
contexts()
Returns an array of all open browser contexts.
In a newly created browser, this will return zero browser contexts. Note: This is async in the remote SDK, unlike the native Playwright API.
Returns RemotePlaywrightBrowserContext[]
newContext(options?)
Creates a new browser context. It will not share cookies/cache with other browser contexts.
If directly using this method to create BrowserContexts, it is best practice to explicitly close the returned context via browserContext.close() when your code is done with the BrowserContext, and before calling browser.close().
Returns RemotePlaywrightBrowserContext
newPage(options?)
Creates a new page in a new browser context. Closing this page will close the context as well.
This is a convenience API that should only be used for single-page scenarios and short snippets. Production code and testing frameworks should explicitly create browser.newContext() followed by browserContext.newPage() to control their exact life times.
Returns RemotePlaywrightPage
close(options?)
Closes the browser and all of its pages (if any were opened).
The Browser object itself is considered to be disposed and cannot be used anymore. This is similar to force-quitting the browser.
Other
browserType()
Get the browser type name (chromium, firefox, or webkit) that was used to launch this browser.
Note: Returns the name string. This is async in the remote SDK, unlike the native Playwright API.
Returns 'chromium' \| 'firefox' \| 'webkit'
version()
Returns the browser version.
Note: This is async in the remote SDK, unlike the native Playwright API.
Returns string
newBrowserCDPSession()
Returns the newly created browser session.
CDP Sessions are only supported on Chromium-based browsers.
Returns { sessionId: string }
startTracing(page?, options?)
Starts Chromium Tracing.
This is a Chromium-only API. Only one trace can be active at a time per browser.
stopTracing()
Stops Chromium Tracing and returns the trace data.
This is a Chromium-only API. Returns the trace data as a Buffer.
Returns Buffer

