Skip to content

Frame for quick API load testing with Postman and K6.

License

Notifications You must be signed in to change notification settings

felixsteinke/postman-k6-api-load-testing

Repository files navigation

API Load Testing

This repository gives the opportunity for quick API load testing. It lets you record a usage scenario in the browser to then transform it to a Postman Collection or a K6 Load Test.

Installation

Prerequisite: Installed NodeJS, Postman and K6

npm install

Usage

1. Export the Network HAR

  1. Open Chrome as browser.
  2. Open Dev Tools (F12) and go to the network tab.
  3. Check Preserve log and set filter to Fetch/XHR in the Dev Tools.
  4. Open the interested website.
  5. Execute the interested usage scenario.
  6. Export the HAR file from the Dev Tools and save it to 1-har-exported.

Chrome Dev Tools

2. Filter HAR

Filter the HAR file for only the XHR requests and save them to 2-har-filtered.

npm run har-filter

3. Create Postman Collection

  1. Open Postman.
  2. Import the HAR file from 2-har-filtered as Postman Collection.
  3. Modify the collection like the authentication.
  4. Export the Postman Collection as json to the 3-postman-collections.

4. Postman to K6

Transform the Postman Collections to K6 Scripts and save them to 4-k6-scripts. Get all required commands:

npm run postman-to-k6

And execute them all.

5. Execute K6 Load Tests

Get all available load test commands:

npm run k6-commands

And execute them as desired.

References

About

Frame for quick API load testing with Postman and K6.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published