Hoe can I automatically store response header and body in a file as a log for a test case? (I use Katalon in command line mode)
I do not think Katalon Studio supports automatically storing response and body in a file.
You need to write test case codes to write data into files for yourself.
Getting JSON body from the HTTP response is easy, writing a JSON into a file is also easy.
But it is not very easy to resolve paths for files appropriately for logging purpose.
I have just posted another tips:
This post presents an external java library named Materials. The Materials library makes it easy to resolve output file path in a well structured format like:
This format of path includes a directory layer of Timestamp . This makes it easy to store files chronologically just like Katalon’s Reports. It would be best suited for logging purpose.
I have written another post
I believe I have developed a useful tool for logging HTTP Response Header and Bodies.