26

I am using the Postman Collection Runner to run the same request multiple times using iterations. My tests work as expected, but I'm not able to see the individual responses for each request.

Is it possible to view the responses for requests in the Postman Collection Runner?

6 Answers 6

39

In the latest version of Postman you can see all the data from the collection run for each individual request.

In the Collection Runner, Click on the request name and all the details of the request and response can be viewed.

enter image description here

More information can be going on the Debugging using the Request & Response body section of this page

5
  • 1
    Is there anyway to include those in the exported results? Commented Apr 12, 2018 at 19:17
  • Not in the UI export I don’t think, possibly running the collection through a Newman script? It’s not something I do so I would need to try it out. :) Commented Apr 12, 2018 at 20:17
  • Thanks Danny. I tried newman, but it's hard to know what data is available to the export template. Commented Apr 12, 2018 at 23:48
  • When I try this I get a message saying "Data unavailable (only data about the top 10 historical runs is stored). The solution is to click the 'New' button at top right and re run the collection.
    – Alan Smith
    Commented Aug 8, 2019 at 8:24
  • I believe that there is an open issue around this problem and will be addressed in future releases. Commented Aug 8, 2019 at 8:37
31

This might help somebody, I tried

pm.test(responseBody, true)

and this printed the response in run summary.

2
  • Looks good! Do you have hint how to print out also the requestBody? pm.test(requestBody, true) is not working :-)
    – DaveX
    Commented Jun 5, 2018 at 14:59
  • 2
    Hi @Dafka, To print request, you can use the request object like this, pm.test(request.url, true); pm.test(request.body, true); pm.test(request.header, true); You can find more about the request object @ postmanlabs.com/postman-collection/Request.html#~definition Hope this would help. Thanks.
    – Vicky
    Commented Jun 6, 2018 at 18:07
5

Let me add more details about the shadowcharly solution.

Your results may be viewed if you assign responseBody variable to tests array (in Tests tab)

tests["body"] = responseBody

enter image description here

and export it as json (on the interface you only see the zero/one results if test passed or not).

enter image description here

enter image description here

enter image description here

It's not very useful but this is the only way I've found.

1
  • The given statement for test, returns a { "name": "body", "status": "pass" }, in my output. Can you please suggest what can I do?
    – Daksh Shah
    Commented Feb 7, 2018 at 7:08
1

If you are repeating exactly the same query, you could use the test name to show the result:

tests['Test to see value of key Key'+ keyValue] = testResult....

You will have a different test for each value received, not exactly a log, but works fantastic ;)

1

I know this is old, but postman has added a feature in the collection runner. enter image description here

2
  • 1
    Its not saving the responses for me. Any idea what could be problem
    – arqam
    Commented Jul 26, 2021 at 12:51
  • @arqam Same here
    – shaedrich
    Commented Jan 14, 2022 at 16:15
0

In my postman(Version 10.15.4) I can simply choose Persist responses for a session option on Collection Runner UI.

After that, you can click each test case and see the response body. Please refer to the attachment screenshots. enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.