Scenario:
Get-https://XXX/project/file/data/ProjectFileID/refresh
I need to loop this request (with some delay time 5 sec) until the status is processed in the response json.
Note 1: Status will be like first Processing and then Processed . If it is failed then it will be Error.
Note2: Loop should end when Status is Processed or Error .
Note 3 : Loop should continue when Status is in Processing .
For this i tried below script -Here i am getting error as Couldn’t evaluate the test script: Error: sandbox: execution interrupted, bridge disconnecting and tool is closing"
let status = “Processing”;
while (status === “Processing”) {
const delay = 20000;
pm.sendRequest('Get-https://XXXX.com/api/v3/project/file/data/FileID',function(err,res){
if (err) {
console.error('Error:', err);
return;
}
status = response.json().Status;
if (status === "Processed" || status === "Error") {
console.log('Status:', status);
return; // Exit the loop
}
});
}