Write response body to file

Is there a convenient way to write the response body to an html file for debugging purposes?

Many Thanks

OTG Load Testing

The easiest thing was to console log the response body and redirect stderr to a file:
k6 run test.js 2>resp.html

Do a little editing and open in a browser

To somewhat improve the UX of that, you can also use the --logformat raw or --logformat json and --console-output=./path/to/console-log-file.log