Hi,
I’m new to K6 and I’m doing a base test for my application.
I updated my K6 to version 0.46 and the browser is no longer visible when running a script, was this removed in this version or is the configuration different?
I’m using windows and in cmd I’m running the command: set “K6_BROWSER_ENABLED=true” && k6 run script2.js
My code:
import { browser } from ‘k6/experimental/browser’;
export const options = {
scenarios: {
ui: {
executor: ‘shared-iterations’,
options: {
browser: {
type: ‘chromium’,
},
},
},
},
thresholds: {
checks: [“rate==1.0”]
}
}export default async function () {
const page = browser.newPage();try {
await page.goto(‘https://myurl’)page.locator('#user_email').type('user'); page.locator('#user_password').type('password'); const submitButton = page.locator('(//button[@type="submit"])'); await Promise.all([page.waitForNavigation(), submitButton.click()]); const btnMenuAtividades = page.locator('#top_menu_activities') await btnMenuAtividades.click() const btnListaDeAtividades = page.locator('#top_menu_activities_list') await btnListaDeAtividades.click() check(page, { 'Adicionar Atividade': page => page.locator('(//input[@placeholder="Adicionar Atividade"])').isVisible() === true, })
} finally {
page.close();
}
}