How to export/download Response Body into an external file from Postman Collection Runner Results?

前端 未结 5 1323
无人共我
无人共我 2020-12-17 17:15

I am working on a project where I have to hit a web service multiple times with different values of a variable

For example, http://mywebservice.com?variable1={{valu

5条回答
  •  无人及你
    2020-12-17 17:48

    I don't think you can download the response body of the request in the collection runner - You can export the test results but i'm not sure that this contain the response body data. You can also click on each request in the runner and see the response body but this is still all within the UI.

    For individual requests you can use the Send and Download option, which will show you the response body:

    I'm sure there is some workaround that you could do to save the response body as an environment or global variable and then export this after but it seems like an awkward and slightly hacks solution.

    pm.globals.set('response_body', JSON.stringify(pm.response.json()))
    

    This would get overwritten each time though, so you would need to change the variable name each time, or have something in your code to change its name, to get a unique set of them.

    These can then be exported and saved locally using the Manage Environment section.

提交回复
热议问题