Forum Discussion
mamar
13 years agoContributor
Thanks for your time.
Though i have all correct values, still i get the below message with the given code (from different response and not from first post). But somehow i researched and modified the code and finally got the answer what i need. Enclosed the code for your future reference, if you need.
-> Assertion failed:
assert (TrnType in ["Debit", "Credit", "Check"])
| |
| false
Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Debit, Credit, Debit, Credit, Debit, Credit, Credit, Credit, Check, Debit, Credit
-> error at line: 17
The corrected 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}
TrnType.each{assert (it) in ["Debit", "Credit", "Check"]} // Here checks that each TrnType is available in either of three values one by one as list.
Thanks.
Though i have all correct values, still i get the below message with the given code (from different response and not from first post). But somehow i researched and modified the code and finally got the answer what i need. Enclosed the code for your future reference, if you need.
-> Assertion failed:
assert (TrnType in ["Debit", "Credit", "Check"])
| |
| false
Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Credit, Debit, Debit, Credit, Debit, Credit, Debit, Credit, Credit, Credit, Check, Debit, Credit
-> error at line: 17
The corrected 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}
TrnType.each{assert (it) in ["Debit", "Credit", "Check"]} // Here checks that each TrnType is available in either of three values one by one as list.
Thanks.