Hi Im Getting Cannot read property 'get' of undefined error while running the Post requisition iterative please help me to resolve this
[
{
"first_name": "{{Name}}"
}
]
Pre-request Script:
var names = JSON.parse(pm.environemnt.get("names"));
if(!names){
names = ["aaa","bbb","ccc,"dddd"];
}
var currentName = names.shift();
pm.environment.set("Name",JSON.stringify(currentName));
pm.environment.set("Names",JSON.stringify(names));
Test Script:
var names = JSON.parse(pm.environemnt.get("names"));
if(names && names.length > 0){
postman.setNextRequest("CollectionReq");
}
else{
postman.setNextRequest(null);
}
Environment: No environment selected