import com.eviware.soapui.support.GroovyUtils import com.eviware.soapui.support.XmlHolder import org.w3c.dom.Node import org.apache.commons.lang.StringUtils def groovyUtils = new GroovyUtils(context) def xmlHolder =groovyUtils.getXmlHolder(messageExchange.getResponseContent()) String xPath = "//clients/client" Node[] nodeArray = xmlHolder.getDomNodes(xPath) int actualCount = nodeArray.length int expectedCount = context.expand(‘${#Project#ClientCount}‘).toInteger() log.info "Actual : nodeArray.length of "+xPath+" : "+actualCount log.info "Expected : nodeArray.length is : "+expectedCount assert actualCount==expectedCount
时间: 2024-10-09 02:14:24