Forum Discussion
What are you wanting to save? The response of each test ran via the test using each XML file?
Hi,
Yes, my requirement is to have the XML Response files being saved in a folder or directory location.
It would be best if the output files saved use the same request name or a way to identify for which request the corresponding response is being saved.
Thanks for your proactive follow-up,
Rahul
- groovyguy7 years agoChampion Level 1
When I have had to deal with this before, I've made use of a groovy script assertion that scrapes the Response from the test and saves it. You could append either a time stamp or a relevant/unique piece of data from the request or response to the file name to keep track of which request the response is tied to.
- RD616657 years agoNew Contributor
Hi Lead,
Is it possible for you to share the script which I can use as a reference to write my own as I don't have any background on Groovy.
Thanks again for your quick response.
Regards,
Rahul
- groovyguy7 years agoChampion Level 1
I can't, but I'll provide some links.
Write content to files with Groovy
Add a script assertion. In there, right click in the script editor and select "Get Data" and navigate to the test step you want to pull the request from. Once you get that and store it in a variable, you can use the above links to save it to a file.
Related Content
- 8 years agojscorzelli