Make karate to throw error when there is null result from jsonPath expression

Viewed 9

Json:

    def a = {
    "list1":[
        {
            "key":[]
        },
        {
            "key":[]
        }
    ],
    "list2":[
        {
            "key":[]
        },
        {
            "key":[]
        }
    ]
     
 }

Now for this jsonPath expression will be $..key it throws null result

If i try from karate And match each a..key == ${someexpectedvalue} since the array doesn't meets the expected result it should throw error but now it is getting passed

0 Answers
Related