Groovy脚本获取请求xml

时间:2021-02-09 20:21:17

I can get the response xml using Groovy script. I need to get the request XML since I need to add 'assertion script' to my soap ui testing.

我可以使用Groovy脚本获取响应xml。我需要获取请求XML,因为我需要在我的soap ui测试中添加'断言脚本'。

I am using the following code to get the response xml

我使用以下代码来获取响应xml

def response = new XmlHolder(messageExchange.responseContentAsXml)

But I am not sure how to get the request xml of SOAPUI. Can anyone please help me in getting the request xml of SOPAUI?

但我不知道如何获取SOAPUI的请求xml。谁能帮助我获取SOPAUI的xml请求?

1 个解决方案

#1


4  

To get the request content as a string you can use

要将请求内容作为字符串获取,您可以使用

testRunner.testCase.testSteps["Name of your teststeup"].testRequest.response.getRequestContent()

More information on the SoapUI API can be found at http://www.soapui.org/apidocs/index.html?overview-summary.html. Have a look at the Request and Response class in particular for the methods and properties they provide

有关SoapUI API的更多信息,请访问http://www.soapui.org/apidocs/index.html?overview-summary.html。请查看Request和Response类,特别是它们提供的方法和属性

#1


4  

To get the request content as a string you can use

要将请求内容作为字符串获取,您可以使用

testRunner.testCase.testSteps["Name of your teststeup"].testRequest.response.getRequestContent()

More information on the SoapUI API can be found at http://www.soapui.org/apidocs/index.html?overview-summary.html. Have a look at the Request and Response class in particular for the methods and properties they provide

有关SoapUI API的更多信息,请访问http://www.soapui.org/apidocs/index.html?overview-summary.html。请查看Request和Response类,特别是它们提供的方法和属性