问题描述
我试图修改另一个testCase的请求,但无法获取它的XML。
我想知道参数模式以获取它使用此方法:
def holder = groovyUtils.getXmlHolder(targetStep.getName()+#Request)
这个方法似乎在自己的testCase中寻找targetStep。我想知道如何指定这个方法,我正在寻找特定的testCase中的targetStep。
如果这种方式不可行, d想知道如何在特定的testCase中获取testStep的XML Content以修改节点值。
预先感谢!
最后找到了一个替代方案:
def holder = groovyUtils.getXmlHolder(targetStep.getPropertyValue(request))
holder.setNodeValue(// NodeName,'newValue')
holder.updateProperty()
targetStep.getHttpRequest()。 setRequestContent(holder.getXml())
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 !
Finally found an alternative :
def holder = groovyUtils.getXmlHolder( targetStep.getPropertyValue("request") )
holder.setNodeValue("//NodeName",'newValue')
holder.updateProperty()
targetStep.getHttpRequest().setRequestContent(holder.getXml())
这篇关于SaopUI GroovyScript - 如何修改位于另一个TestCase中的请求XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!