【问题1】
SoapUI+Groovy做接口测试时,脚本执行到第三行报错,报错内容"org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA"
脚本片段如下:
import com.eviware.soapui.support.GroovyUtils //Get response def groovyUtils = new GroovyUtils( context ) def holder = groovyUtils.getXmlHolder('inquire#Response')//GroovyUtils获取返回的xml消息的操作XmlHolder
错误分析:根据字面意思:是解析Xml异常,无法对返回的结果进行解析
解决办法:把def holder = groovyUtils.getXmlHolder('TestTest#ResponseAsXml')改为 def holder = groovyUtils.getXmlHolder('TestTest#Response'),
即去掉AsXml,问题解决
注:Property ResponseAsXml is for REST; Property Response is for SOAP