Collection Runner- How we can save response in local computer for documentation

As we know when user run individual request from workspace directly, User can save response in text file through “save to a file” from “Save Response” dropdown.

But When we run request(s) from collection runner, How we can save the response?

I can see 2 options which are not feasible as per my opinion.
A. Open the collection runner, Select the required collection and request, select the “save responses” checkbox and run it.
click on individual request, select the response body and manually copy the response and paste it to locally which is not feasibly because we can’t do manually one by one for 100 requests.

B. Click on “export Result” button in the Run Result tab where results are showing but saved file contain the status(pass/fail) rather then response.

P.S. To save the response in text file locally just for the future response, Looking without newman.
Let me me required more details.

Hi @aakashjain8693,

By locally do you mean that you are running Postman remotely?

The only thing I can think of to achieve this, without using newman, is to save the request and response as environment variables, to which then you can export that environment and get the values out from there. Aside from that you can also send the response to a special / custom web server for recording purposes, using pm.sendRequest and putting the response in the request payload.

At the moment, I cant think of any other ideas on how to achieve this. Hope one of the options above are viable!

Best,
Orest

1 Like

Thanks!! Since we are in testing world, Always history and result important.

cc @allen.helton

I agree with @odanylewycz. To make this easy, you can add a test script on your collection so it automatically runs for every request.

let responses = pm.collectionVariables.has('collectionResponses') ? pm.collectionVariables.get('collectionResponses') : [];

responses.push(pm.response.json());

pm.collectionVariables.set('collectionResponses', JSON.stringify(responses));

When the collection is has completed, you will have every response from every request in that collection run in the collectionResponses collection variable.

1 Like