问题
I am trying to modify a request from another testCase and I'm unable to get its XML.
I'd like to know the parameter pattern to get it with this method :
def holder = groovyUtils.getXmlHolder( targetStep.getName() + "#Request" )
This method seems to look for "targetStep" in its own testCase. I'd like to know how to specify to this method that I'm looking for "targetStep" in a specific testCase.
If it's not possible that way, I'd like to know how to get the XML Content of a testStep in a specific testCase in order to modify node values.
Thanks in advance !
回答1:
Finally found an alternative :
def holder = groovyUtils.getXmlHolder( targetStep.getPropertyValue("request") )
holder.setNodeValue("//NodeName",'newValue')
holder.updateProperty()
targetStep.getHttpRequest().setRequestContent(holder.getXml())
来源:https://stackoverflow.com/questions/31474938/saopui-groovyscript-how-to-modify-request-xml-located-in-another-testcase