Hello.
I am trying to run a simple script using k6-browser on windows .
I am using the argument K6_BROWSER_HEADLESS=false , the chrome browser gets launched but the URL is not passed and only a blank page opens and hence times-out. Message given on the CLI is
Uncaught (in promise) creating new page in browser context: timed out after 30s executor=shared-iterations scenario=ui
Script is 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();
}
}