0

I am trying to convert the postman collection to K6 using the utility postman-to-k6. postman-to-k6 works perfectly fine and converts the collection to k6.js script when the collection has simple requests like Get and Post with simple key value pair json body.

But when I want to convert a collection that has file upload using the formdata, the command

postman-to-k6 .\collection.JSON -o K6-script.js

fails. giving me the error

The "path" argument must be of type string. Received an instance of Array

The postman collection is huge with sensitive data and multiple requests in which file upload has been used. It's not possible to share the collection here.(again its my assumption that its failing due to formdata)

Is there any way I can figure out what exactly is causing the problem?

FYI: The collection works perfectly fine in postman too.

Jay
  • 339
  • 1
  • 7
  • 23
  • I have the same issue and not able to find a solution. Have you been able to? The only reference I got was "We suggest you post your issue at api-deck/postman-to-k6. The project is active and maintained on this fork." – gagneet Mar 23 '22 at 17:55

1 Answers1

0

Try using the following command, it has worked for me and produced at least a partial output and I can identify the place where it is breaking:

postman-to-k6 my.postman_collection.json -e my-env.postman_environment.json --skip-pre --skip-post -s -o k6-output.js

Basically use the -s (--separate option) and optionally you can use the --skip-pre and --skip-post also.

gagneet
  • 35,729
  • 29
  • 78
  • 113