BUG? JSONPath Existence Match cannot use condition
This was discovered when I chatted about a different issue in the forum. I am posting it here so the problem is more clear and hope to get some attention. Let's say I have a response like below
{"errors": [{
"code": "100",
"message": "Message for 100",
},
{
"code": "200",
"message": "Message for 200",
}
]}
I created "JSONPath Existence Match" asserts as below
Expression: $..errors[?(@.code == 100)]
Expected result: true
Expression: $..errors[?(@.code == 800)]
Expected result: false
I would think both VALID, i.e. the actaul result of the second expression would be false. However, the actual result was true. The second assertion failed with the error:
-> Comparision failed for path [$..errors[?(@.code == 800)]], expecting [false], and actual was [true]
However, if I create "JSONPath Count" asserts instead as shown below:
Expression: $..errors[?(@.code == 100)]
Expected result: 1
Expression: $..errors[?(@.code == 800)]
Expected result: 0
Both assertion will be VALID, i.e. the actual result of the second expression will be 0 (which is the expected value).
This is not consistent! Should this be a BUG?
I tried this on both SoapUI OpenSource 5.2.1 and the SoapUI NG Pro 1.5.0 (ReadyAPI 1.5.0). They all behave the same.
Hi Andrew_net,
Sorry that it took me so long to get back to you.
I’ve got the confirmation from our R&D Team that this issue had been fixed in our maintenance Ready! API 1.6 build. You can download it here:
https://support.smartbear.com/downloads/readyapi/nightly-builds/
Please let me know if the issue still persists.