Forum Discussion
With Contains, if you select regular expression, then there needs to be a complete match to the whole response body, so something like::
.*<\w+:rte>100<\/\w+:rte>.*
Rather than using contains, use XPath or another type of assertion (script assertion?)
When you use XPath and declare the namespaces, the prefixes are yours to make up (or let SoapUI make them up for you), and then those declarations are responsible for mapping the prefixes to the right namespaces. So even if more namespaces are added, as long as you don't change your declarations, then your existing assertions will still work.
//myns1:rte[1]
And as for script assertions, the default when using XmlSlurper is to ignore namespaces and just assume there's no conflicts.
assert new XmlSlurper()
.parseText(messageExchange.responseContent)
.Body.something.someThingElse.rte
.find {it == '100'} == true
- sunilkumarcm7 years agoNew Contributor
I have checked "Use token as regular expression".But even then if I use regular expression in contains assertion, it is not working
Related Content
- 7 years ago