25

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?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
thedev
  • 2,816
  • 8
  • 34
  • 47

6 Answers6

37

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

Danny Dainton
  • 23,069
  • 6
  • 67
  • 80
31

This might help somebody, I tried

pm.test(responseBody, true)

and this printed the response in run summary.

Vicky
  • 871
  • 9
  • 16
  • Looks good! Do you have hint how to print out also the requestBody? pm.test(requestBody, true) is not working :-) – DaveX Jun 05 '18 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 @ http://www.postmanlabs.com/postman-collection/Request.html#~definition Hope this would help. Thanks. – Vicky Jun 06 '18 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.

Piotr Dawidiuk
  • 2,961
  • 1
  • 24
  • 33
  • The given statement for test, returns a `{ "name": "body", "status": "pass" },` in my output. Can you please suggest what can I do? – Daksh Shah Feb 07 '18 at 07: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 ;)

shadowcharly
  • 134
  • 8
1

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

Rakesh
  • 104
  • 1
  • 11
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

Necromancer
  • 869
  • 2
  • 9
  • 25