0
[
    {
        "key": "test1",
        "category": "test",
        "name": "test1",
        "translations": 
        {
            "english": "eng"
        }
    },
    {
        "key": "test2",
        "category": "test",
        "name": "test1",
        "translations": 
        {
            "english": "eng2",
            "german": "German"
        }
    },
    {
        "key": "test3",
        "category": "power",
        "name": "test1",
        "translations": 
        {
            "EN_lang": "jik"
        }
    }
]

Here, we have multiple field's are with different values and we have to match value in translations (field position will change on every call)

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248

1 Answers1

1

You have to be clear about what you want to assert. Hint, the new contains deep (available in 0.9.6.RC4) can help:

* match response contains deep { key: 'test2', translations: { english: 'eng2' } }

Else you should look at transforming the JSON into a shape where it is easier to do the assertions you want: https://github.com/intuit/karate#json-transforms

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248