cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to compare two JSON responses

SOLVED
Highlighted
Occasional Contributor

Best way to compare two JSON responses

 

Hi Team,

 

I would like to compare the actual JSON response with an expected JSON response by ignoring certain nodes and properties..Could you please let me know what is the best approach to do using readyapi?

 

I found a way to do the same for XML files looking for the support on JSON as well.

 

https://github.com/nmrao/groovyScripts/blob/master/compare/CompareWithIgnoreElements.groovy

Much appreciated..

 

Thanks

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Rao, Richie, thank you!

 

Hi @venkireddy1991 , I found a couple of threads you might want to check out:

 

https://community.smartbear.com/t5/SoapUI-Pro/compare-a-response-with-a-json-file/m-p/168926

https://community.smartbear.com/t5/SoapUI-Pro/Compare-2-JSON-responses-in-soapUIPRO-Groovy/m-p/16996...

 

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Required to write code as needed for the data.


Regards,
Rao.
Highlighted

Hi @venkireddy1991,

If you search the readyapi and soapui open source forums for "compare json" you should get the .json equivalent of what you need. I remember there have been a couple of separate posts about comparing json in the last 3 months or so

Cheers

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Manager

Rao, Richie, thank you!

 

Hi @venkireddy1991 , I found a couple of threads you might want to check out:

 

https://community.smartbear.com/t5/SoapUI-Pro/compare-a-response-with-a-json-file/m-p/168926

https://community.smartbear.com/t5/SoapUI-Pro/Compare-2-JSON-responses-in-soapUIPRO-Groovy/m-p/16996...

 

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Highlighted
Community Hero

You can check below library, there are some samples available too.
https://github.com/lukas-krecan/JsonUnit



Regards,
Rao.
Community Manager

Thank you Community for help🙂

 

@venkireddy1991 did the links provided help you? Please mark the best reply as a Solution🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors