Forum Discussion
richie
Community Hero
Hey mehdihs,
I think the contains assertion only works for xpath (xml), not jsonpath (json).
So the regex does work, but only for xml.
Im not sure but i think i remember trying this before and ending up having to use a script assertion instead.
Ta
Rich
I think the contains assertion only works for xpath (xml), not jsonpath (json).
So the regex does work, but only for xml.
Im not sure but i think i remember trying this before and ending up having to use a script assertion instead.
Ta
Rich
appliedMagic
4 years agoOccasional Contributor
Hi,
add the following JSONPath Expression:
$.data[?(@.ratu_desc=='Total Canada')].ratu_desc
and the Expected Result should be set to:
[Total Canada]
Then it does not matter where "Total Canada" is found, as long as the structure does not change.
You can read more about this here:
https://support.smartbear.com/readyapi/docs/testing/assertions/reference/property/json-match.html
Related Content
- 6 years agoyognsal