K6 is a fast performance tool now in the current software industry to test the performance test on a system. K6 is developed under the Go language it's supported to script in Javascript.
Here I'm trying to create a Postman collection and convert the collection to a k6 script only using execution 2, 3 command whole to generate a performance script too. It's too easy and too fast to execute. K6 finally gives a descriptive summarization of the performance test as well. Following my hands-on practical.
1. Create a Postman collection with all API or API operations and tryout with the execution 'Run as Collection' option by Postman itself.
2. Export postman collection and the environment variables as a json
3. Install Postman to k6 nodejs model using the following command
npm install -g @apideck/postman-to-k6
4. Generate k6 script via using the following command
postman-to-k6 [postmand-collection].json -e [postman-environment].json -o [script-name].js
5. Generated k6 script as follows
6. Run the k6 script with using 'k6 run [script_name]'
References - https://k6.io/blog/load-testing-with-postman-collections/
No comments:
Post a Comment