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

#1

Hey,

Is this possible ?

#2

This from @sivcan might be able to help with this?

1 Like
#3

Thanks ! I tried but only the last response is exported. Not the ones from the previous iterations. Weird… Any idea ?

#4

@sivcan would be able to help with this but probably not until he’s back online :grin:

I think, if I remember, you might need to modify the server code to append the response rather than just write over the previous response.

1 Like
#5

The script uses the request name in Postman as the filename for the export. It sounds like you’re iterating over the same request.

As Danny said, you’ll need to edit script.js to check for an existing file, and if so append the response.

Alternatively, if you want each response in a separate file, edit the Test script at the collection level so that the request name will be unique each time: you could append a timestamp for example + Date.now().

1 Like
#6

Nice ! Got it working ! Thanks to you both !

2 Likes
#7

Great! Which route did you go down in the end?