5
votes

Is it possible to rerun the tests created in the post response test without resubmitting the request?
For example you submit an API request in Postman, then it comes back with some data.
I want to just re-run the scripts against this data.
Could be really useful in debugging these post-response scripts.

postman image of test

I want to rerun Tests in area 1 without hitting the Send button (area 2). That way I can test the javascript correctness of my Test scripts without having to wait for server responses.

3
Could you explain or expand on the question some more please, it seems like you could chain the requests and run them in the collection runner x amount of times. - Danny Dainton
I want the same thing. My case: I'm writing test code for a POST call, and I don't want to create a bunch of dummy objects in the service while I work out bugs in my code. - Patrick

3 Answers

2
votes

You can use https://postman-echo.com/post and their API will echo the request you send. So basically you create the actual request once and then use the result in the ECHO call to do the development.

More info here: https://docs.postman-echo.com/?version=latest

I'm afraid there is no better way at the moment.

0
votes

You can write test entire test or the part you want to execute twice in a function and call that function 2 times, that the easy and low effort and maintenance way I am looking

0
votes

I was looking for the same thing and came across this tip on the PostMan Community. https://community.postman.com/t/re-run-test-script-without-re-sending-request/9160/8

Basically you:

  1. Make your request
  2. Save your response as an example
  3. Create a PostMan mock from that response
  4. Rerun and build up your test against the mock (and any variants, like failure cases)
  5. Run against the original and verify everything is good.

While this workaround helps get the job done, I do wish that they could just make it so that you could hold the original state of the response and the env, run your tests, reset to the original state, rerun your tests and tweak until it all works.