No results for

Powered byAlgolia
⚠️ This is the archived documentation for k6 v0.44.

contexts()

Access all open BrowserContexts.

Returns

TypeDescription
ArrayArray of BrowserContext objects

Example

import { chromium } from 'k6/experimental/browser';
export default function () {
const browser = chromium.launch();
console.log(browser.contexts().length); // 0
const context = browser.newContext();
console.log(browser.contexts().length); // 1
context.close();
browser.close();
}