Open source

Chromium

chromium is a browser type that you can import from the browser module ('k6/browser'). It lets your test attach to a Chromium-based browser that is already running, instead of one that k6 launches and manages for you.

Use it when the browser lifecycle isn’t k6’s to manage, for example when the browser runs in a separate container or when a third-party provider hands you a browser session. Everything else stays the same: the returned browser exposes the same browser module API as a k6-managed browser.

MethodDescription
connectOverCDP(wsEndpoint)Attaches to an existing Chromium-based browser over the Chrome DevTools Protocol (CDP) and returns the Browser.