簡體   English   中英

通過SoapUI將結果導出到文本文件中

[英]Export result in text file by SoapUI

我正在使用dotmailer.com ESP並使用SoapUI來調用API。 我可以使用JSON格式獲取廣告系列的摘要,但也想將該廣告系列的摘要提取到文本文件中,但找不到任何方法。 有人可以幫忙嗎? 謝謝。

您可以使用groovy做到這一點。 groovy script testStep在testCase內添加一個groovy script testStep ,您就可以從前一個testStep獲得響應並將其保存在文件中。 由於您的問題中沒有太多細節,一般的方法可以是:

// 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

希望能幫助到你,

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM