Forum Discussion
Thanks for the response, Rao.
Unfortunately, it is not the same. What making the matter worse is that I tested more types of checking we are using and found more problems. For the same response JSON shown above, I created the following assertions:
JSONPath Match:
#1.1
JSONPath: $.errors[0].code
Expected value: 100
#1.2
JSONPath: $..errors[0].code
Expected value: 100
#1.3
JSONPath: $..errors[?(@code == 100)]
Expected value: [{"code":"100","message":"Message for 100"}]
#1.4
JSONPath: $..errors[?(@code == 100)].code
Expected value: [100]
#1.5
JSONPath: $..errors[?(@code == 100)].message
Expected value: [Message for 100]
#1.6
JSONPath: $..errors[?(@code == 300)]
Expected value: []
#1.7
JSONPath: $..errors[?(@code == 300)].code
Expected value: []
#1.8
JSONPath: $..errors[?(@code == 300)].message
Expected value: []
JSONPath Existence:
#2.1
JSONPath: $.errors[0].code
Expected value: true
#2.2
JSONPath: $..errors[0].code
Expected value: true
#2.3
JSONPath: $..errors[?(@code == 100)]
Expected value: true
#2.4
JSONPath: $..errors[?(@code == 100)].code
Expected value: true
#2.5
JSONPath: $..errors[?(@code == 100)].message
Expected value: true
#2.6
JSONPath: $..errors[?(@code == 300)]
Expected value: false
#2.7
JSONPath: $..errors[?(@code == 300)].code
Expected value: false
#2.8
JSONPath: $..errors[?(@code == 300)].message
Expected value: false
The tests result are below:
SoapUI (open software version):
Passed: 1.1, 1.2, 1.3, 1.4, 1.5, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8
Failed: 1.6, 1.7, 1.8 (these three test cases should also pass)
Ready!API 1.5 and 1.6:
Passed: 1.1, 2.1, 2.2
Failed: 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8
So the behaivor are really different! I will attach the test case to this post, could you please take a look? Thanks.
To run the test case, please start the mock service and run the test suite "TestJSONPath".
Regards.
https://support.smartbear.com/product-list/
- andrew_net9 years agoOccasional Contributor
Thanks, Rao.
Opened a request.
- JKambli9 years agoStaff
Bug logged SOAP-5217
Thanks