I want to compare the 2 JSON files and get the list of differences. One JSON file is the base file and want to compare it with the second JSON file which would have new nodes/missing nodes/different names. I want to get the list of differences. A JSON file would have around 10,000 objects.
Asked
Active
Viewed 29 times
1
-
if the linked answer does not fit your needs, you are welcome to contribute code or look for another framework – Peter Thomas Apr 08 '21 at 07:22
-
@PeterThomas : the provided link can help, but how can I use the same for comparing 2 JSON files, as while comparing the files it fails at first difference and exits, the further diffference in the file are ignored. Can i iterate through the objects in the json file and collect the difference? – john Apr 08 '21 at 08:51
-
you can, and it is explained in the link, but it may be more trouble than it is worth. I'll give you my honest opinion. this is the least of your problems if you are testing. if you get a failure - you just need to fix it and move on. you can argue that if you have multiple failures you will waste time - but guess what all that is in development mode anyway and karate gives you a debugger and nice reports, all you need to do is re-run a few times. if you are expecting karate to be a programming language, you may need to look elsewhere – Peter Thomas Apr 08 '21 at 09:41