Is there a way to get the "Response Body" in the test results of Postman collection
Solution 1
More simplistic way is:
tests[`Response Body: ${responseBody}`] = true;
Solution 2
You can get the response body like this in your test section:
const body = pm.response.json();
Then you can print it in your test results as:
tests["Response Body ", body] = true;
Solution 3
In the latest version (5.5.0) you can see the response data for each request by clicking on the request name in the Collection Runner. This will give you the details about the request made and the response received.
user1558490
Updated on June 14, 2022Comments
-
user1558490 almost 2 years
I have Postman collection to run POST request 10 iterations, in each iteration I have different values for the variables in the request body, and I am doing that by using
CSV
.After completing running the collection, I cannot see the "Response Body" for each iteration. it shows data for the test results and statistics, but not for the actual response body.
Is there any idea to how I can get the response body for each request/iteration in the collection, is that not available in Postman, is there any other tools can do that?
-
Triynko almost 4 yearsWhen I look there, it just says "Response body was not logged". It used to display it, and now it does not.
-
Danny Dainton almost 4 yearsThis was an old answer. Before the run, you need to check the box that says 'save responses' or something like that. This will then show the response bodies.