Java “如何解决错误”;意外元素:CDATA";在通过groovy脚本运行测试步骤时?
我运行的测试套件包含15个测试步骤,其中混合了groovy脚本和soap请求步骤 当我手动运行时,它运行得非常完美,因为它在通过groovy脚本执行时会发出错误消息,如“Unexpected Element:CDATA” Groovy脚本:Java “如何解决错误”;意外元素:CDATA";在通过groovy脚本运行测试步骤时?,java,testing,soap,groovy,soapui,Java,Testing,Soap,Groovy,Soapui,我运行的测试套件包含15个测试步骤,其中混合了groovy脚本和soap请求步骤 当我手动运行时,它运行得非常完美,因为它在通过groovy脚本执行时会发出错误消息,如“Unexpected Element:CDATA” Groovy脚本: for(tc in testsuite.testCaseList) { for(stp in tc.testStepList) { if (!stp.isDisabled()) { testRunner.
for(tc in testsuite.testCaseList)
{
for(stp in tc.testStepList)
{
if (!stp.isDisabled())
{
testRunner.runTestStep(stp)
def assertionList = stp.getAssertionList()
..........
}
}
}
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def responseHolder = groovyUtils.getXmlHolder("requestName#Response")
def appId = responseHolder.getNodeValue("//*:application/*:applicationId")
testRunner.testCase.testSuite.setPropertyValue("AppId",appId)
通过另一个groovy脚本步骤获取响应数据:
for(tc in testsuite.testCaseList)
{
for(stp in tc.testStepList)
{
if (!stp.isDisabled())
{
testRunner.runTestStep(stp)
def assertionList = stp.getAssertionList()
..........
}
}
}
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def responseHolder = groovyUtils.getXmlHolder("requestName#Response")
def appId = responseHolder.getNodeValue("//*:application/*:applicationId")
testRunner.testCase.testSuite.setPropertyValue("AppId",appId)
有谁能给我你解决这个问题的建议吗谢谢
Karunagara Pandi G请编辑您的问题,并提供
requestName#Response
的值和完整错误。您好,我正在尝试从响应中获取应用程序Id的值。这是响应中的一个标记。Ok。我相信问题在于回应。如果问题属于回应,我该怎么办。我可以在手动运行测试步骤时获取“appid”。但唯一的问题是我在运行“groovy脚本”时遇到了这个问题,正如我在文章中提到的。如果响应中存在问题,请询问以修复响应。