No results for

Powered byAlgolia
⚠️ This documentation is outdated. Please visit grafana.com for the latest k6 documentation.📚

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();
}
}