[英]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.