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.
npm install
- Open Chrome as browser.
- Open Dev Tools (F12) and go to the
network
tab. - Check
Preserve log
and set filter toFetch/XHR
in the Dev Tools. - Open the interested website.
- Execute the interested usage scenario.
- Export the HAR file from the Dev Tools and save it to 1-har-exported.
Filter the HAR file for only the XHR
requests and save them to 2-har-filtered.
npm run har-filter
- Open Postman.
- Import the HAR file from 2-har-filtered as Postman Collection.
- Modify the collection like the authentication.
- Export the Postman Collection as
json
to the 3-postman-collections.
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.
Get all available load test commands:
npm run k6-commands
And execute them as desired.