I am sending three requests in pre-req for authenticating the user and getting the access token.
The way i am sending the requests is:
const codeGetRequest = {
url: pm.variables.get(‘test-code-url’),
method: ‘GET’
};
pm.sendRequest(codeGetRequest, function (err,res){
if(//some condition){
console.log(‘No Code found. User should sign in.’);
}
else{
//sending a second GET request
}
});
//Sending a third request (POST) here
The issue i am facing is that the the second GET request is getting sent after the third(POST) request when checked in console.
Please advise if i am doing something wrong here.
NOTE: all the request are getting sent but not in the sequence it is written.