1

The issue is with the validation. Here when I run the tests both the validations are passing, but I could see them in the response, the price is coming as null (price[]). My doubt is how its finding originalPrice when the price array itself is null.
In the validation, I have the below ones:

And match Response.data.abc[].price[] == '#array'
And match Response.data.abc[].price[].originalPrice == '#present'.

Sample response:
 "data": {
    "abc": [
 "abcnumber":001,
 "price": [],
]}
wp78de
  • 18,207
  • 7
  • 43
  • 71
  • sorry I don't understand this at all so I say "PASS" - any other karate users please help. I will close this as a duplicate of this after a few days: https://stackoverflow.com/a/60639597/143475 – Peter Thomas May 05 '21 at 09:34
  • Hi,the issue is with the validation.In the validation i have the below ones -->And match Response.data.abc[*].price[*] == '#array' # And match Response.data.abc[*].price[*].originalPrice == '#present'.Here when i run the tests both the validations are passing,but I could see the in the response the price is coming as null (price[]).My doubt is how its finding originalPrice when the price array itself is null. – Emma George May 06 '21 at 05:12
  • can you please learn how to "format code" in stack overflow, edit your question and try again - with a clear example that anyone can paste into a feature and try. – Peter Thomas May 06 '21 at 05:26
  • Hi,I have updated the description.Hope it helps. – Emma George May 06 '21 at 11:14
  • no it doesn't. your JSON is not well formed. I also think that karate may be too complicated for you, so I strongly recommend that you look for another tool. by well-formed I mean you should be able to paste it here: https://jsonformatter.curiousconcept.com – Peter Thomas May 06 '21 at 12:06

0 Answers0