Uses the BrowserContext to create a new Page and returns it.
Type | Description |
---|---|
object | A new Page object. |
import { chromium } from 'k6/experimental/browser';
export default async function () { const browser = chromium.launch(); const context = browser.newContext(); const page = context.newPage();
try { await page.goto('https://test.k6.io/browser.php'); } finally { page.close(); browser.close(); }}