A file ‘xk6-browser’ exists at my working directory, it is approximately 30KB in size.
I’ve created a simple test in a file called browser-test.js
The test attempts to launch a ‘chromium’ browser
When I type ‘./xk6-browser run Browser/browser-test.js’ in PowerShell from my working directory a Windows dialog appears “How do you want to open this file?”, with options such as Adobe, Visual Studio, Notepad, etc.
A file ‘xk6-browser’ exists at my working directory, it is approximately 30KB in size.
Where did you get this file? The xk6-browser binary should be around 30MB in size, not 30KB. Was this a typo?
My hunch is that this was an HTML or text file that you mistakenly downloaded as xk6-browser, which is why Windows was prompting you to open it in a specific program. And it worked fine when you compiled your own binary with xk6.
If you don’t want to compile your own, make sure to download an official Windows binary from our GitHub releases page.
There’s a xk6-browser-<version>-checksums.txt file there you can use to confirm whether you have the correct archive. You can compare that SHA256 checksum with the output of the Get-FileHash cmdlet in PowerShell. You should see something like this:
Then your file is being corrupted while downloading or something is corrupting it locally. There could be many reasons for this. Try using a different network connection. Do you have an antivirus running that could be falsely detecting and corrupting it?
FWIW I tested with the release binary and it works fine for me in PowerShell on Windows 10.
For xk6-browser-v0.2.0-windows-amd64.msi the Get-FileHash is returning 92DACCCF03886F5F1B01CFCD496B96C8844917BED42CC3F7A6DF3B9D95D41D9E
on two separate computers
I’m still new to this feature but as far as I can tell the xk6 browser is starting correctly on my machine.
I’m still facing this issue. I have created the xk6-browser binary in the current working directory using the below commands. But still the XK6 Browser command opens Windows ‘How Do You Want to Open This File?’ popup. Please help on this issue.
Firstly, have you seen Imiric’s post in this thread on downloading the official binary and double checking the SHA256 of the downloaded binary to compare it against the one that is listed with the releases? Could be a useful work around if the following answer doesn’t help.
Secondly, I’ve just ran those commands on Windows 11 in powershell, and hit the same issue. I was able to get around this by ensuring that in the xk6 build command we name the output file correctly with .exe. Try this now and let us know if that helps:
Hi @ankur, Running the below command fixed the issue. Now I’m not getting the Windows ‘How Do You Want to Open This File?’ popup after running the below command. Thanks for the quick response