Groovy script to get the request xml

我只是一个虾纸丫 提交于 2020-01-11 04:12:08

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/12106955/groovy-script-to-get-the-request-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!