方法com.eviware.soapui.support.XmlHolder#的歧义方法重载



当我在 SoapUI 5.5.0 中尝试这个时髦的脚本时,出现此错误:

groovy.lang.GroovyRuntimeException: Amambious Method overload for method com.eviware.soapui.support.XmlHolder# .无法解析要为 [null] 调用的方法,因为以下两者之间的原型重叠:[interface org.apache.xmlbeans.XmlObject] [interface org.w3c.dom.Node] 行错误:19

import com.eviware.soapui.support.XmlHolder
log.info "welcome to canada"
def name=context.expand ('${#TestCase#name}')
log.info context.expand ('${#TestSuite#place}')
//log.info context.expand('${#AddAutomation#id}')//its not going to grab values or properties of other testcases 
def id=testRunner.testCase.testSuite.testCases["AddAutomation"].getPropertyValue("id")
def age=testRunner.testCase.testSuite.setPropertyValue("age","23")
def department=testRunner.testCase.testSuite.testCases["AddAutomation"].setPropertyValue("department","CSE")
def request=log.info testRunner.testCase.testSuite.testCases["AddAutomation"].testSteps["Add"].getPropertyValue("Request")
def xmlnew=new XmlHolder(request)
xmlnew.setNodeValue("\typ:addEmployeetyp:name","name")
xmlnew.setNodeValue("\typ:addEmployeetyp:id","id")
xmlnew.setNodeValue("\typ:addEmployeetyp:age","age")
xmlnew.setNodevalue("\typ:addEmployeetyp:department","department")

您的脚本具有:

...
def request=log.info testRunner.testCase.testSuite.testCases["AddAutomation"].testSteps["Add"].getPropertyValue("Request")
def xmlnew=new XmlHolder(request)
...

log.info将始终返回null,因此下一行错误。您真正想要的很可能是:

...
def request=testRunner.testCase.testSuite.testCases["AddAutomation"].testSteps["Add"].getPropertyValue("Request")
log.info request
def xmlnew=new XmlHolder(request)
...