No results for

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

newPage([options])

Creates a new Page in a new BrowserContext and returns the page. You do not need to create a new BrowserContext prior to using newPage.

ParameterTypeDefaultDescription
options
objectnull

Returns

TypeDescription
objectPage object

deviceScaleFactor example

import { chromium } from 'k6/experimental/browser';
export default async function () {
const browser = chromium.launch({
headless: false,
});
const page = browser.newPage({
viewport: {
width: 375,
height: 812,
},
deviceScaleFactor: 3,
});
try {
await page.goto('https://test.k6.io/');
} finally {
page.close();
browser.close();
}
}