问题
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.
回答1:
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,
来源:https://stackoverflow.com/questions/33895330/export-result-in-text-file-by-soapui