Introducing our new CEO Don Johnson - Read More

loadimpact/postman-to-k6

By loadimpact

Updated almost 4 years ago

Convert Postman collections to k6 JavaScript for load and performance testing.

Image
1

10K+

Converts a Postman collection JSON file into the equivalent k6 JavaScript file for load and performance testing.

Features

The following Postman features are supported in the conversion:

  • Prerequest scripts.
  • Test scripts.
  • Variables (at all scopes + dynamic).
  • Data files.
  • Authentication methods (except Hawk).
  • postman.* interface (exceptions below).
  • pm.* interface (exceptions below).
  • Global variables exposed by Postman: globals environment data iteration.
  • xml2Json conversion.
  • File formats v2 and v2.1.

Usage

If you have a Postman collection located /path/to/postman/collection/MyCollection.postman_collection.json, you use the Docker container as follows:

docker run -it -v "/path/to/postman/collection/:/output/" loadimpact/postman-to-k6 /output/MyCollection.postman_collection.json -o /output/test.js

After the conversion, you can run the resulting k6 test script as follows:

k6 run /path/to/postman/collection/test.js

Docker Pull Command

docker pull loadimpact/postman-to-k6