I am using dotmailer.com ESP and using SoapUI for calling API. I can get summary of the campaign in JSON format but also I want to extract summary of that campaign into a text file but couldn't find any way. Anyone can help? Thanks.
Asked
Active
Viewed 2,017 times
0
-
You mean, want to log the response received? – Rao Nov 25 '15 at 02:50
-
No actually , i want to export data itself. But i think there is no way for this right? – Can Aslan Nov 25 '15 at 10:24
-
Which format? extract the data out of json to csv file or just json format? Then you may use groovy script test step. Input to that will be you json and output can be whatever you wish. – Rao Nov 25 '15 at 11:59
-
final will be csv actually but in first data output can json also. Then can convert it to csv ot other output. – Can Aslan Nov 25 '15 at 14:17
-
1My manager give up exporting data for now. No need answer this question. Thanks all. – Can Aslan Dec 02 '15 at 12:28
1 Answers
0
You can do it using groovy. Simple add a groovy script testStep
inside your testCase, there you can get the response from a previous testStep and save in a file. Since there are not many details in your question a generic way to do so could be:
// get the test step
def testRequest = context.testCase.getTestStepByName('Test Request')
// get the response
def response = testRequest.getPropertyValue('Response')
// create a file
def file = new File('C:/temp/response.txt');
// save the response to it
file << response
Hope it helps,

albciff
- 18,112
- 4
- 64
- 89