I want to test the following workflow structure and set env in each request.
In first request test script,
var st = [1,2,3]
var i = st.length;
for(var j=0; j<i; j++) {
pm.environment.set("id", st[j]);
postman.setNextRequest("nextRequest");
};
in Next Request prescript,
console.log(
Run ${pm.environment.get(“id”)});
in console log, there is only Run 3 shown.
The problem is that the env variables are overwritten with the last elements. And I can see only the last element of the list and the request is using the last element.
I would like to know How can I keep the env variables not to be overwritten?