首页 > 解决方案 > 通过 groovy 脚本运行测试步骤时如何解决错误“意外元素:CDATA”?

问题描述

我正在运行包含 15 个测试步骤的测试套件,其中包含 groovy 脚本和肥皂请求步骤。

当我手动运行时,它运行完美,因为它在通过 groovy 脚本执行时给出错误消息,如“意外元素:CDATA” 。

Groovy 脚本:

for(tc in testsuite.testCaseList)
{
   for(stp in tc.testStepList)
   {
      if (!stp.isDisabled())
      {
         testRunner.runTestStep(stp)

         def assertionList = stp.getAssertionList()
         ..........
      }
   }
}

通过另一个 groovy 脚本步骤获取响应数据:

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

标签: javatestingsoapgroovysoapui

解决方案


推荐阅读