Thanks Joyce for your reply. Let me explain this issue in detail.
I wanted to automate this API. From another API response I get an array of locations and counting the array length I assign that value to a global variable - X ( i.e. pm.globals.set(“Variable Name”, “Variable Value”); ). I iterate the run of this ‘getDetails’ API for X times where X is the number of total locations. In every iteration I changed the value of “RecentLocationID” variable through pm.globals.set in the “Tests” section.
Everytime I run the iterations using ‘Collection Runner’, I can successfully run the iterations. But when I use newman for executing the tests then it returns an error for the variable “RecentLocationID”.
As the execution can be properly done, using ‘Collection Runner’ but why I cannot execute properly using newman? This was my query.