【发布时间】:2019-06-06 22:12:38
【问题描述】:
当我在 SoapUI 5.5.0 中尝试这个 groovy 脚本时,我得到了这个错误:
groovy.lang.GroovyRuntimeException:方法 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:addEmployee\typ:name","name")
xmlnew.setNodeValue("\\typ:addEmployee\typ:id","id")
xmlnew.setNodeValue("\\typ:addEmployee\typ:age","age")
xmlnew.setNodevalue("\\typ:addEmployee\typ:department","department")
【问题讨论】:
-
我猜,
request是空的 - 如果这是有意的,那么你必须投射请求