Contain assertion - how can I 'blank out' a part of element text which changes with every response
Hello fellow soap users,
I am building a regression test. And the easiest way is ofcourse to make one contain-assertion of the complete response. However, there are elements that change everytime I execute.
For example:
<ns1:RandomNumber>234</ns1:RandomNumber>
Is there I way I can validate if the response contains something like:
<ns1:RandomNumber>XXX</ns1:RandomNumber>
With the XXX that 'blank out' that part of the validation. So it only checks the presence of the positions, and not what it actually says there?
Kind regards
There is an example in the documentation for the same
In your case, use xpath assertion with
XPath expression as
matches(//*:RandomNumber, '\d{3}')
And Exprected Result as
true
NOTE: ignore namespace from the image below and use your name spaces by clicking on declare.