I want to test the following workflow structure.
in first request 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("getNext");
};
In getNext pre test script,
var id = pm.environment.get("id");
console.log(`Run ${id}`);
In console, there is only Run 3
message is 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 requests are using the last element.
I would like to know How can I keep the env variables not to be overwritten?
EDIT I remove my messy question and add simple workflow.