I want to execute 3 requests (api1, api2 and api3) one after the other. I want to make api3 request dependent on values(type:int) of api1 and api2.
In api1 request test body:
var data = pm.response.json();
var count1 = data.length;
In api2 request test body:
var data = pm.response.json();
var count2 = data.length;
if(count1 == 0 && count2 == 0){
postman.setNextRequest(null);
}
Doing this, it throws a "ReferenceError: count1 is not defined"
after firing the api2 request.
I don't want to execute the request api3 if both the count values (count1 and count2) are 0. Please help!