Export result in text file by SoapUI

你离开我真会死。 提交于 2019-12-13 04:45:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!