Forum Discussion
groovyguy
7 years agoCommunity Hero
I've read posts here on the forums of people using Selenium in groovy scripts, but I have not done that so I cannot begin to speak to it. I may be able to shed some light on the second option, though.
Here's a snippet that can parse a response for multiple Rate Factors.
import com.eviware.soapui.support.XmlHolder def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def holder = groovyUtils.getXmlHolder( messageExchange.responseContentAsXml ) def nodeCount = holder["count(//*:e)"] nodeCount = nodeCount.toInteger() log.info ("NodeCount: " + nodeCount); def rateFactors = holder["//*:e/*:RateFactor"]; for (int i = 0; i < nodeCount; i++) { // Process the data however you want log.info( rateFactors[i]); }
- sprice0901617 years agoContributor
Thank you for your response!
Wouldn't you know that the datasources can be configured to read through the response xml/json data. It took a little doing but once I got it into a datasource format, it became much easier.
Related Content
Recent Discussions
- 21 days ago