Is there a way to access the iteration number in Postman REST Client?
3 answers
I don't know if there is an internal way to get the iteration number, but I believe you should keep track of this number through the code yourself. Here's a quick snippet of code:
var value = environment.count;
value++;
postman.setEnvironmentVariable("count", value);
If you put this in a pre-query editor or a test collection editor that you are sure will run once per iteration, it will effectively keep track of the iteration count.
+1
source to share
According to the Mail User Reference , pm.info.iteration is the value of the current iteration being performed.
Example:
console.log(pm.info.iteration);
+1
source to share