Forum Discussion

radhika1's avatar
radhika1
Contributor
7 years ago
Solved

Need to know how to compare two json response one with json object and other with json array .

6 Replies

    • JHunt's avatar
      JHunt
      Community Hero

      Hi Radhika,

       

      How would you normally do it if they both had single objects? However you normally would, you should be able to do the same thing but just get the first object out of the the list.

       

      For example:

       

      assert json1.'consumerProfile'.'consumerProfileIdentifier'.'profileID' == json2.'consumerProfile'.'consumerProfileIdentifier'[0].'profileID'

      • radhika1's avatar
        radhika1
        Contributor
        Can you help me how to do this for all objects if possible.