Forum Discussion
http://community.smartbear.com/t5/SoapUI-NG/JSON-Path-expression-not-working-on-project-I-updated-to-1-6-0/td-p/114978/jump-to/first-unread-message
- andrew_net9 years agoOccasional Contributor
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.1JSONPath: $.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.1JSONPath: $.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: falseThe 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.
- nmrao9 years agoChampion Level 3If you see the thread that I added above, it says they have problems around json path which is broken in 1.6 according to the topic author and I suggested to raise a case with support using the link provided.
https://support.smartbear.com/product-list/- andrew_net9 years agoOccasional Contributor
Thanks, Rao.
Opened a request.
Related Content
- 3 years ago
Recent Discussions
- 4 days ago