I’m trying to trigger a “pm.sendRequest” inside a for loop and the request is getting sent only after the iteration is completed, though I have kept the request inside the loop.
My Test look like,
for (i=0;i<5;i++)
{
const requestObject = {
url: 'https://reqres.in/api/users?page=2',
method: 'GET',
header: 'Content-Type:application/json',
}
console.log(i)
pm.sendRequest(requestObject, (err, res) => {
console.log(i)
})}
The "i" which is getting printed inside the pm.sendRequest is alwas printed as 5.
Could you please help me in resolving this issue.