more than what meets the eye
- Ritesh Ranjan
Scopes
// Set variables
pm.environment.set("url", "www.google.com")
pm.global.set("url", "www.google.com")
// Get variables
pm.variables.get("url")
pm.environment.get("url")
pm.global.get("url")
- Set of key-value pairs
- Can be exported and Shared
JavaScript code to execute during 2 events in the flow
- Pre-request script
- Test script under the Tests tab
// Prefix
var prefix = "mdl_heroku_";
// Clear global variables
pm.globals.unset(prefix + "sessionToken");
// Set a random user name
pm.globals.set(prefix + "userName", "Perf_rit_" + prefix + Date.now() + "@hello.mileiq.com");
// example using pm.response.to.have
pm.test("response is ok", function () {
pm.response.to.have.status(200);
});
// Set the request to be executed next
pm.setNextRequest("request_name");
// Stop workflow execution
pm.setNextRequest(null);
newman run postman-config/MDL_Rest_Login_Flow_Automated.postman_collection.json
-e postman-config/Actual_Router_Perf.postman_environment.json
--exitCode 1