Forum Discussion

Roma's avatar
Roma
Regular Visitor
4 years ago

JSON Path Match for multiple objects/elements

Hi, guys!

Is there a way to write an assertion in SoapUI for matching multiple objects/elements in one assertion?

I ask about situation when need to combine firstName+lastName+address.streetAddress+address.city in a JSON Path Match assertion:

 

[
{
  "firstName": "John",
  "lastName" : "doe",
  "age"      : 26,
  "address"  : {
    "streetAddress": "naist street",
    "city"         : "Nara",
    "postalCode"   : "630-0192"
  },
  "phoneNumbers": [
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888"
    },
    {
      "type"  : "home",
      "number": "0123-4567-8910"
    }
  ]
}
]

 

 

Estimated result #1:

 

[{firstName=John, lastName=doe, streetAddress=naist street, city=Nara}]

 

Estimated result #2(At least this way):

 

[{streetAddress=naist street, city=Nara}]

 

 Thank you very much...

No RepliesBe the first to reply