I am trying to run the k6-browser test on windows. It opens up a new chrome window but the URL is not passed and an untitled blank tab is opened.
After 30s , the test times out with the error
Uncaught (in promise) creating new page in browser context: timed out after 30s executor=shared-iterations scenario=ui
The script as follows:
import { browser } from 'k6/browser';
import { check } from 'k6';
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
};
export default async function () {
//const context = await browser.newContext();
const page = await browser.newPage();
try {
await page.goto("https://www.google.com/");
await Promise.all([
page.locator('#loginbutton').click({force:true},{buton:'left'}),
//page.waitForNavigation(),
]);
/*await page.locator('input[name="login"]').type("admin");
await page.locator('input[name="password"]').type("123");
await Promise.all([
page.waitForNavigation(),
page.locator('input[type="submit"]').click(),
]);
const header = await page.locator("h2").textContent();
check(header, {
header: (h) => h == "Welcome, admin!",
});*/
} finally {
await page.close();
}
}
Any help is much appreciated