No results for

Powered byAlgolia

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/x/browser';
export default function () {
const browser = chromium.launch({
headless: false,
});
const page = browser.newPage({
viewport: {
width: 375,
height: 812,
},
deviceScaleFactor: 3,
});
page.goto('https://test.k6.io/');
page.close();
browser.close();
}