amelaao
7 years agoNew Contributor
JSONPath Existence Match always returns true
Hello,
I am using JSONPath Existence Match Assertion on an array and I noticed that it always evaluates to true.
This is my expression and no matter which custom property I use inside the condition, the result always evaluates to true.
$.ApplicationResult.HotelList[?(@.HotelId==${#TestSuite#hotelIId})]
I'm using SOAPUI 5.4.0.
Thanks!
It looks like a bug. I also tested this on the PRO version and it is not reproducible there.
You could also use a JSONPath RegEx Match Configuration. The JSONPath Expression can stay the same. You will only have to add a regular expression like:
\[.+\]
Then you can set the expected results to 'true'.
You will notice then that if the id doesn't exist the assertion will fail.
Cheers!