- URL 1 --> post request --> JSON respose 1
- URL 2 --> post request --> JSON respose 2
How to compare response 1 and response 2 ?
response 2 will have extra attributes so cannot directly use match command
Response1 { name : hello, country : ABCD} Response2 { name : hello, country: ABCD, state: xyz}
Want to compare only name and country attributes and don't want to hardcode comparison like match response1.name == response2.name
In future extra attributes may be added and don't want to modify the script frequently
Or
Is there anyway to pass both the responses to JavaScript function from karate and perform comparison
Like call read ('comparison.js') response1 response2