Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 363

Not able to generate K6 script using postman-to-k6

$
0
0

Hi, I am trying to use postman-to-k6 to generate a K6 script however it failed with the error below. The xyz.js was not even generated.

It seems complaining a syntax error in the xyz.js (which is supposed to be the output of postman-to-k6).

I know the correct syntax is
config.options[“{{apiKeyHeader}}”] = ${pm[Var]("apiKey")};

How could I fix a syntax error in a *.js script that was never generated?

==========================================

C:\Projects\Benstro>npx postman-to-k6 xyz.postman_collection.json -e xyz_ST.postman_environment.json -o xyz.js
Unexpected token (29:22)
27 | address: “{{txProcessorBase}}/health”,
28 | auth(config, Var) {

29 | config.options.{{apiKeyHeader}} = ${pm[Var]("apiKey")};
30 | }
31 | })
32 |

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 363

Trending Articles