Forum Discussion
- Hello,
can you please copy/paste the entire script verbatim ?
I'm guessing it's just a syntax issue, but we'll see once you add the script.
Regards,
Vladimir
SmartBear Software - ssharmaContributorimport com.eviware.soapui.support.XmlHolder
def groovyutils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = new XmlHolder( messageExchange.responseContentAsXml )
holder.namespaces["tns"] = "http://pss.com/PartSelect-v1"
holder.namespaces["psi"] = "http://pss.com/PartSelect/2011-07-21"
def quart = context.expand( '${Validate Fluid#Quarts}' ) //get value from datasource
def liter = context.expand( '${Validate Fluid#Liters}' ) // get value from datasource
//log.info liter
//log.info quart
if (quart == (liter * 1.05))
{assert true }
else
{assert false }
} // end of node1.each - Hi,
you might need to convert these values to their corresponding number types, ie
def quart = Float.parseFloat(context.expand( '${Validate Fluid#Quarts}' )) //get value from datasource
def liter = Float.parseFloat( context.expand( '${Validate Fluid#Liters}' )) // get value from datasource
(or whatever type is appropriate)
Does that help?
regards!
/Ole
SmartBear Software