JSONPath - negative match alternatives
- 6 years ago
Hi pb1
I don't think there is a native functionality option. I asked this question about 6 months ago - but the 3 XPATH/XML options I'm aware of didnt work for JSONPATH/JSON.
The only answer I found was to use groovy (which Rao kindly put together for me).
If someone does come back with a non-groovy answer - great! I'd welcome knowing the option - but for now when I have to do this when the response type is json - I rely on groovy.
I have one other suggestion that 'might' help you get around this that's just popped in my head - so never tried it myself. Depending on your webservice (for this particular test step which returns json) you could add an Accept header (value = application/xml) - to force the response content type to XML. Perhaps you could use one of the XML related options using this approach? I appreciate it wouldn't be the first option you might consider - but if you're really adamant you dont want to try groovy - switching the content to XML for this single test might allow you to get around this?
Hope this helps!......although I suspect it didn't!
Cheers,
rich