Contain assertion - how can I 'blank out' a part of element text which changes with every response
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks everyone for suggestions.
@tester213243 any updates?
Sonya Mihaljova
Community and Education Specialist
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards,
Rao.

- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »