Hi Amit
Thanks. I am pasting the latest code here. As you suggested, I have moved the timeout(in milliseconds) parameter to first position. However the values of url and idx are not recognized in the function. It was working before moving the parameter to first position.
Here is the code snippet of calling
//for loop to parse the response and get urls from the result items
console.log("url before calling the function= "+url); //This is printed correctly
setTimeout(performRequest,11000,url,idx); // Call the function with a delay of 11 seconds
idx++;
*//end of for loop*
*//end of test*
//Function defined in the same test tab
function performRequest(url,idx) {
pm.sendRequest(url,function (err, res) {
console.log('Finsihed: ' + idx); //idx and url values are undefined
console.log('url = ' + url);
});
}
Version which worked before, however semantically it seems incorrect
setTimeout(performRequest(url,idx), 11000);