Postman.setNextrequest doesn’t work. I tried with multiple ways, but still not working
My requirement to run a new endpoint after the loop
pm.test("Get code of each countries", function () {
var jsonData = pm.response.json();
pm.environment.set("variable_key", jsonData.map((value) => value.code));
});
var country_code = pm.environment.get("variable_key".split(","));
for (var i = 0; i < country_code.length; i++) {
pm.environment.set("code", country_code[i]);
postman.setNextRequest("https/Endpoint/country=" + country_code[i]);
}
postman.setNextRequest(null);
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
Can you please help me to resolve this issue ?