How to run a script with open browser on K6 v0.46


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’)


const submitButton = page.locator('(//button[@type="submit"])');

await Promise.all([page.waitForNavigation(),]);

const btnMenuAtividades = page.locator('#top_menu_activities')

const btnListaDeAtividades = page.locator('#top_menu_activities_list')

check(page, {
    'Adicionar Atividade': page => page.locator('(//input[@placeholder="Adicionar Atividade"])').isVisible() === true,

} finally {

Hi @fsimoneto,

Welcome to the forum!

Please see our migration guide to adapt to the new version.


Thanks inancgumus,

I saw the new changes for v.046 but I didn’t understand if the browser can be visible at the time of script execution or not.

Yes, it’s visible. You might also want to check out our docs for more information. Especially, this part.

1 Like

This worked for me:

In cmd: set "K6_BROWSER_HEADLESS=“false” && k6 run script2.js

Thank you @inancgumus

1 Like