Saving request data sent to mock server

I am trying to implement the following scenario in the postman.


  1. Setup a mock server

  2. Send a request to the mock server

  3. Access the data received on the mock server

  4. Store that data to a global variable and use it later in the testing

Step 1 and step 2 are done. but stuck at step 3.

How should I access the data from the request sent to the mock server?

1 Like

Can you maybe explain which problem / scenario you are trying to solve?

Hi vdespa,
I haven’t found answer but I am dealing similar usecase keyulpax.

I have setup mock server using postman I call it e.g. by this url {{url}}/get?foo=bar.
If I call requeste from postman it is fine and I can process parameter by “Tests” in Request.
But when the url is called from browser, I can’t use Pre-Request Script or Tests anymore.
The aim is to catch parameters from url directly in response as save it as variable. Is that possible?