How to run two prerequisite (POST and GET) request fir a single method. I want POST method to run first but GET method is running first

My question:

How to run two prerequisite (POST and GET) request fir a single method

Details (like screenshots):
I have one POST method request suppose C. I need to sun to pre request script A (POST method ) and B (GET method) to provide the required parameters for C request. How can i achived that.

I’ve already tried:
I have tried giving two pre request script but its running GET method first and then POST method. I want POST method to run first.

Hi @sudarshan.ohal,

If I understood your question correctly, you want to run 3 different requests and then use response from previous request in next requests.

One way to achieve this is use 3 different requests and have them in collection.

First request will fetch the data and then you can use test to save response in some global or collection variables. That variable can be used in pre test of next request.

Hope this helps :slightly_smiling_face:

@darkphoenix : The solution you are telling me, that i have already implemented. However i dont want to include those two request as a main requests in my collection. I want those to be a pre request scripts. Do you know prioritization in pre request scripts?

Hi @sudarshan.ohal ,

I believe you are using pm.sendRequest() function of postman.

This is asynchronous function.

If you want to wait for the response to arrive then execute the second request, then you may need to use callback function.