Groovy脚本获取请求xml [英] Groovy script to get the request xml
问题描述
我可以使用Groovy脚本获得响应xml。我需要获取请求XML,因为我需要添加断言脚本到我的soap ui测试。
我使用以下代码来获取响应xml
p> def response = new XmlHolder(messageExchange.responseContentAsXml)
但我不确定如何获取SOAPUI的请求xml。任何人都可以请求帮助我获得SOPAUI的请求xml吗?
要获取请求内容作为字符串,您可以使用
testRunner.testCase.testSteps [testteup的名称]。testRequest.response.getRequestContent()
有关SoapUI API的更多信息,请参阅 http://www.soapui.org/apidocs/index.html?overview-summary.html 。查看Request和Response类,特别是它们提供的方法和属性。
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.
I am using the following code to get the response 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?
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
这篇关于Groovy脚本获取请求xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!