ChromiumInteraction

class ChromiumInteraction(browser: ChromiumWrapper, noSandbox: Boolean = false, startupTimeoutMs: Long = DEFAULT_STARTUP_TIMEOUT_MS)

High-level interaction with a Chromium-family browser over the Chrome DevTools Protocol: launches the browser process, connects to its default page target, and shuts everything down when the interaction is over.

Parameters

browser

browser executable wrapper

noSandbox

whether to disable the Chromium sandbox

startupTimeoutMs

maximum time to wait for the browser to announce its DevTools endpoint

Constructors

Link copied to clipboard
constructor(browser: ChromiumWrapper, noSandbox: Boolean = false, startupTimeoutMs: Long = DEFAULT_STARTUP_TIMEOUT_MS)

Types

Link copied to clipboard
class Page

Interaction with a single page target of a running browser.

Functions

Link copied to clipboard

Ensures the browser executable is available and working.

Link copied to clipboard
fun withPage(action: suspend ChromiumInteraction.Page.() -> Unit)

Starts the browser with a fresh profile, connects to its default page target, runs action against it, and finally kills the browser and cleans the profile up. Blocking call.