Forum Discussion

AlbertSoapUI's avatar
AlbertSoapUI
Contributor
6 years ago

Saving REST requests and responses in prettyprint style

Hi,

 

I am maintaining a project that contains a lot of code for (among other things) saving raw requests and responses of REST messages.

 

Since ReadyApi version 2.5.0 there is an option 'Dump file' for each request which will save the response to that request to an allocated place:

https://www.soapui.org/getting-started/working-with-soapui/saving-responses.html

 

An other option (don't know since when) is to run from command line using option -a to export both requests and responses to an allocated map:

https://support.smartbear.com/readyapi/docs/soapui/running/automating/gui.html#reports

Which would look like something like (in Mac form)

/Applications/ReadyAPI-2.6.0.app/Contents/java/app/bin/testrunner.sh -a -f/Users/yournameonyourpc/someoutputmap "-RTestCase Report" /Users/yournameonyourpc/yoursoapuiprojects/yourproject

Both options look promising, because then I can throw away a lot of code, which I no longer have to maintain or edit after that. However, in its raw form both options don't save it in prettyprint style, but in one blurb of content.

 

So my question is: how can I save all requests and responses of a running test in pretty print format, with minimal use of code? 

If not possible: how can I read 'unpretty' REST information from files and save them in pretty print style, the simplest way? (have to be useful for automation)

 

Thank you in advance for your good idea(s), inspiration!

 

Albert

3 Replies