Assertion that a JSON path does not exist

547 views
Skip to first unread message

victor.p...@cabforce.com

unread,
Jun 26, 2015, 10:06:42 AM6/26/15
to jmeter-...@googlegroups.com
Hi,

I am trying to set up a small test in JMeter that sends an HTTP request to an API, gets JSON response as response and briefly parses its content. jp@gc - JSON Path Assertion is used as a post-processor which works great when a JSON path is supposed to be there. However, I fail to figure out how to use it to verify that the path is not there. It looks like "path not found" is not the same as being equal to NULL. Am I right?

The only solution that I could come up with is to use a combination of JSON Path Extractor, assign the result to a variable and then use one more step to assert that variable against '[]'. It does not look nice and I was wondering if there some more elegant solution avoiding extra variables.

Any idea or suggestion is more than welcome! Thanks!

Victor

Andrey Pokhilko

unread,
Jun 29, 2015, 8:08:20 AM6/29/15
to jmeter-...@googlegroups.com, victor.p...@cabforce.com, victor.p...@cabforce.com
Hi,

The assertion negation will be available in 1.3.0, check out latest developer snapshots.

--
Andrey

пятница, 26 июня 2015 г., 17:06:42 UTC+3 пользователь victor.p...@cabforce.com написал:
Reply all
Reply to author
Forward
0 new messages