Run script from terminal

When I try to run the script, I get the following errors.

E:\>k6 run E:\Performance testing project\loadTest.js time="2021-01-15T23:01:59" level=error msg="accepts 1 arg(s), received 3: arg should either be \"-\", if reading script from stdin, or a path to a script file"

or

WARN[0000] The moduleSpecifier "loadTest.js" has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use "https" as scheme.
ERRO[0060] The moduleSpecifier "loadTest.js" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://k6.io/docs/using-k6/modules#using-local-modules-with-docker.

Additionally it was tried to be loaded as remote module by prepending “https://” to it, which also didn’t work.

Remote resolution error: "Get "https://loadTest.js": dial tcp [86.35.3.193:443]: i/o timeout"

The path E:\Performance testing project\loadTest.js is correct.

Can you help me how to fix the following errors?

Hi @Sebastus,

can you please format your error better, and not copy it from the Youtube comments as now all links are going through it …

Have you tried going to the folder and running from the, I am not a windows user, but in Linux, we need to escape spaces in paths with \ and I would expect the same to be true in windows?

I’ve gone ahead and reformatted your question a bit to make it more readable.

in Linux, we need to escape spaces in paths with \ and I would expect the same to be true in windows?

In Windows, you’d typically use quotes around the string to make it a single string containing spaces.

I think that @mstoykov is right however. The lack of quotes and presence of spaces is likely what is causing the error you’re seeing. Would you mind trying the command below instead?

k6 run "E:\Performance testing project\loadTest.js"

Best,
Simme

I used the command suggested by you and it worked!
Thank you all for your involvement.

I apologize for the inconvenience, I’m a beginner, and I want to learn to do performance testing myself.

1 Like

You’re more than welcome! Let us know if we can help you in any other way! :pray: