Error while using chromium.launch()

Hi there!
I am trying to add the k6/browser library to our performance testing suite and I can’t get it to run.
I’ve been following the tutorials in the documentation and while executing the script shown in this page of the wiki, I get the following error, which points to the “chromium.launch” function:

ERRO[0000] Uncaught (in promise) GoError: launching browser: exec: no command
at github.com/grafana/xk6-browser/browser.mapBrowserType.func2 (native)
at file:///…/script.js:6:36(9) executor=per-vu-iterations scenario=default

I am running the test with " k6 run --env K6_BROWSER_ENABLED=true .\script.js ", since the commands shown in the docs don’t work for me.

Thank you so much for your time!

Hi @antonio.vinuelas,

Which version of k6 are you using? If you are working with the latest version (v0.45.0) then you shouldn’t be facing that issue.

If you are building your own binary from source, then you will likely face this issue if you are working off of the latest main branch. What command do you use to create your binary?

Cheers,
Ankur

Hi @ankur, thank you for the quick answer!

I was using 0.44 but I just updated it as you suggested, but the error is still there. I downloaded k6 through the official installer.
Do you think going with a clean reinstallation with Chocolatey will solve this?

Thanks again,
Antonio

Hi @antonio.vinuelas,

I’m not sure why you’re getting that error. To help us reproduce the issue, can you send us:

  1. The version of the OS.
  2. The version of Chrome.
  3. The test script.
  4. The command you are using to run the test.
  5. The whole output of the failed test run.

Cheers,
Ankur