I am writing a script assertion to see if a element value contains in the array list and if it does, it passes.
When I print the element:Number, I get like an example [1,2,3,3]
as array. If Number contains say 3, script has to pass.
I have written below code which is failing, probably because the written value is an array list, how to assert an array value?
def response = messageExchange.getResponseContent()
def xml = new XmlSlurper().parseText(response)
def invoiceNumber= xml.'**'.findAll { it.name() == 'Number'}
log.info "$invoiceNumber"
assert invoiceNumber.contains(1)