Postman is used for building, testing, and delivering API’s. To do the testing in the cloud we integrated Postman with RedLine13 to run any Postman collection inside RedLine13 as a performance test. The Postman Load Testing project is available on github.
Postman Collections
In Postman, a collection is used to allow you to bundle many different requests into one group. Collections are a great way to organize requests so that they “accurately mirror your API”. Postman users also have the ability to add metadata to requests, store sample responses, filter through requests, and more. Postman collections are great ways to manage and organize your API’s and all of their requests, and now you can test those collections on RedLine13 as collections can be downloaded as a JSON file.
Postman Load Testing with RedLine13 – Postman Integration
Postman collections are easy to run on RedLine13. It all starts by modifying a custom load test.
There are 4 easy steps:
- Export Postman Collection
- Clone the RedLine13 Example Project To Your Local Environment
- Package Your Test
- Run Your Test
Step 1: Export Postman Collection
To get started, we first need to export a collection from Postman:
- Navigate to the collection that you want to test, click the three dots to expand the menu, and then hit “Export”.
- You will then be prompted to select collection type: Collection v1, Collection v2 or Collection v2.1, choose which one works best for you.
- Export your collection to your file directory of choice.
Step 2: Clone the RedLine13 Example Project To Your Local Environment
- Clone the repository locally
git clone https://github.com/redline13/plugin-postman.git
cd plugin-postman - Modify CustomTest.js in the constructor to override the defaults. These options are the API options defined in newman
- this.newmanCollection = ‘./Echo.postman_collection’;
- Specify the collection file that you will be attaching to the test. The file will be in the same directory which test is run from, use ./COLLECTION
- this.newmanEnvironment = null;
- Specify environment file (or url to environment file)
- this.newmanGlobals = null;
- Postman Global Variables can be optionally passed on to a collection run in form of path to a file or URL.
- this.newmanIterations = 1;
- Specify the number of iterations to run on the collection.
Step 3: Package Your Test
- RedLine13 requires the package.json which is provided and includes newman. For this reason RedLine13 needs to package the test run.
tar cvf postman.tar CustomTest.js Echo.postman_collection package.json - Include your test(CustomTest.js), collection(Postman collection), package.json
Step 4: Run Your Test
Login to https://www.redline13.com/Service,
- RedLine13 enables load tests on your cloud. You need to first setup AWS Keys.
- This test requires the NVM plugin. Add to your account: RedLine13 Plugin Manager
- Add the plugin by hitting the “+”
- Navigate back to Tests module, click “Start a New Test” then select “Custom test”
- Click “Upload Custom” and select the .tar file we packaged earlier
- Specify Number of Users to simulate
- Required: Advanced Custom Test Options
- Select plugin “Node Version Manager”
- Select 6.* as the node version
- Note: the Load Agent Language should have changed to Node.js
- Advanced cloud options such as Create EC2 IAM Instance Profile and Attaching AWS Instance Profile to a load agent are available via plugins on RedLine13.
- Optional: Modify Advanced Cloud Options to control the number and location of servers.
Once completed, review your parameters, then name and run your Postman load test. The servers will spin up and display your data in real-time. From there, you can view your results as needed. You’re Postman Load Testing!
For more, visit the Postman Plugin GitHub Page.
You can try for yourself and quickly run your own test on RedLine13.