set and get global variables
Set an global variable
allowedMilliseconds
with value
100
pm.global.set("allowedMilliseconds", 100);
Get the global variable
pm.global.get("allowedMilliseconds")
The global variable in real use case. In this example response time is checked to be below 100ms
pm.test("Response time is less than "+pm.global.get("allowedMilliseconds")+"ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(pm.global.get("allowedMilliseconds"));
});
by Valeri Tandilashvili
4 years ago
Postman
test automation
0
Pro tip: use ```triple backticks around text``` to write in code fences