the approach I am following may not be the best one but this is the one with which I was thinking to reach my goal, if there’s a better solution feel free to suggest it please.
In a custom script where I am using Newman as package I am running a Postman collection by using the
iterationCount parameters (see this) so to loop the same collection in many iterations. In each iteration I am saving a dynamic data I am interested with as an environment variable:
var body = JSON.parse(responseBody); postman.setEnvironmentVariable("cart_uuid", body.uuid);
Obviously this means that the environment variable is overwritten at each iteration.
The problem is as far as I understood in Newman the environment variables are only accessible in the
done callback see this that’s to say “when a collection run has completed, with or without errors”. In other words it means that I can not intercept it during the iterations in my script (while I wanted to do it on the
Could you tell me how can I resolve this problem of getting pragrammatically the environment variables in Newman used as package in an iteration?
Thanks in advance