[英]How to run the request multiple times and save the response to a single file in SOAPUI?
我正在 c# 開發一個應用程序來與 SOAPUI 通信。 我有一個名為 TERMEKADAT TestCase 的特定測試用例,我需要調用此 TestCase 的時間超過 1 次並將數據保存到文件(所有響應數據到一個文件)。 在 c# 應用程序中,我可以使用命令行調用測試用例,我可以存儲響應,但我只能這樣做一次(如果我這樣做多次,轉儲文件將被覆蓋,所以最新的數據消失了)。 我能以某種方式將所有請求數據存儲在一個文件中嗎? SOAPUI append 可以在一個文件中響應嗎?
我需要在一個文件中存儲更多回復。
您可以在測試用例的 Groovy 腳本測試步驟中這樣做:
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def resp = new XmlHolder(context.response) //get the response object
def respXml = resp.getXml() //get the XML string from the response
def respFile = new File("/your/dir/yourFile.txt")
respFile.append(respXml)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.