Forum Discussion
mamar
13 years agoContributor
Thanks much. i am able to get the list of all trantypes from the response with minor changes with your code..
import com.eviware.soapui.support.*
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "doDepAcctTrnInq#Response" )
holder.namespaces["ns"] = "http://www.ifxforum.org/IFX_150"
TrnType = holder.getNodeValues("//ns:BankAcctTrnRec//ns:TrnType")
log.info "TrnType : " + TrnType.each{it}
and i am also trying to validate my response is having all the TrnType's either in 'Debit' or 'Credit' or 'Check'. So i tried with the below assertions, but getting failure message and my response is having the TrnType's in these three types. Could you please help me.
assert (TrnType.each{it} in ["Debit", "Credit", "Check"]) - got failure message
assert (TrnType.each{it}.contains("Debit", "Credit", "Check")) - got failure message
In SQL, we use to verify in where condition like this, "<variable> in ("Debit", "Credit", "Check")". Is there any operators in Groovy?
import com.eviware.soapui.support.*
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "doDepAcctTrnInq#Response" )
holder.namespaces["ns"] = "http://www.ifxforum.org/IFX_150"
TrnType = holder.getNodeValues("//ns:BankAcctTrnRec//ns:TrnType")
log.info "TrnType : " + TrnType.each{it}
and i am also trying to validate my response is having all the TrnType's either in 'Debit' or 'Credit' or 'Check'. So i tried with the below assertions, but getting failure message and my response is having the TrnType's in these three types. Could you please help me.
assert (TrnType.each{it} in ["Debit", "Credit", "Check"]) - got failure message
assert (TrnType.each{it}.contains("Debit", "Credit", "Check")) - got failure message
In SQL, we use to verify in where condition like this, "<variable> in ("Debit", "Credit", "Check")". Is there any operators in Groovy?