ERRO[0000] unknown module: k6/x/browser

Hi everyone! I’m new to k6. I was exited to try new feature with browser automation.

I did all the necessary in the article:

By the way you should replace
go install github. com/grafana/xk6/cmd/xk6@latest (didn’t work for me in Win10)
with
go install go.k6.io/xk6/cmd/xk6@latest (this worked)

Below my screen showing the installation was successful:

But then I tried the very same script from your article above and I get this error:
on the screen below CMD output

What did I do wrong?

2 Likes

Hi Alexbirvik,

Thanks for reporting this issue. I noticed that you discovered the issue on Github and fixed the problem.

Thanks for notifying us to update the README.

@inanc But please wait, that is not the problem I reported.
My problem is error: ERRO[0000] unknown module: k6/x/browser

This is not solved. The first issue was just to notify you about readme, yes, but the real issue is an ERROR I get lanching my script.

@inanc Please look at my screenshot I get this error all the time regardless all the installation process was successful:

Hi Alex,

Sorry, I thought it was resolved. Did you follow the steps in our readme?

First install the xk6 and xk6-browser extension:

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --output xk6-browser --with github.com/grafana/xk6-browser

Then run it using the xk6-browser executable:

./xk6-browser run test-xk6.js

Please let me know how it goes.

1 Like

HI @inanc Thanks for the fast reply!

Please take a look: I tried your suggestion and command doesnt work for me in VScode - on the screen right side

Hi Alex,

Sure. Could you try the following command:

.\xk6-browser.exe run test-xk6.js

Or, without .exe:

.\xk6-browser run test-xk6.js

@inanc no, I’ve tried all the possible combinations…

I use Win 10 by the way. Maybe I need to put some changes into PATH manually?

Hmm, weird. Can you validate that there is an xk6-browser binary in the same folder that you’re running the example?

You probably have k6.exe in the folder, so please try:

.\k6.exe run test-xk6.js

Or, without .exe:

.\k6 run test-xk6.js

@inanc Thank you! Now script is working.
But I put both
k6.exe and xk6-browser in the current directory (where my test-xk6.js located).

It is unclear how to set it up from the articles and readme.

I (and probably the most of community) will appreciate if you will provide a comprehensive tutorial how to set up xk6-browser.

Thanks again!

2 Likes

Hi Alex,

We will update the installation instructions accordingly, especially for Windows.

Thank you!

1 Like

Hi everyone!
I have tried the articles I could find about the installation of xk6 on a Windows computer, but I am not able to get it installed on my PC. Please, if anyone has a link to the direct installation guide on Windows, I would appreciate it.

Thanks

Hi @festusinvitesu,

what specifically are you having problems with? Please post the steps you’ve tried and any errors you received so that we can help you.

The installation instructions mentioned above and in our README should work for you. Otherwise, please grab a pre-built binary from our releases page.

Thanks @imiric, I have resolved the issue. I installed Go, ran the binary build command on powershell trminal, and ran my script on powershell terminal using the code below, but it didn’t work.

./xk6-browser run

Then I ran the binary build command on the bash terminal and then used./xk6-browser run to run the script command and it worked.

Lastly, I am trying to produce the following results from my performance testing and I don’t know how best to go about them:

1.) To get the loading time of different pages when when multiple users are assessing the page.
2.) Verify the response the response time of the application under load when the network connectivity is low.
3.) To check the CPU and memory usage of the application

Please could you advise me on how best to go about these using the xk6 browser.
Thanks

I’m glad you were able to resolve it. As you see from the discussion above, if you’re using PowerShell, you should run .\xk6-browser run (or .\k6 run depending on the xk6 build command you used). But Bash terminal should work as per the Linux examples, though we don’t recommend it for running tests.

Please post your questions in a separate forum thread, since it’s not related to this discussion. But before that, please refer to the k6 documentation, run some tests, and let us know what you tried first.