nsn
8 years agoNew Contributor
How to assert a JSON Array with 100+ values for its key names
Hi,
I am have to assert a JSON response using SOAPUI. This response has got an array of 300 elements. It looks something like this:
{
"apiVersion": "0.1",
"errors": null,
"infos": null,
"results": [{
"aReference": "12",
"aBlockItems": {
"aBlockItem": [{
"key": "key1",
"value": null
}, {
"key": "key2",
"value": "N"
}, {
"key": "key3",
"value": "N"
}, {
"key": "key4",
"value": "N"
}, {
"key": "key5",
"value": "0"
}, {
"key": "key6",
"value": "0"
and so on and so forth. I need to assert that all the keys - key1 till key300 are all present in the response. I am trying to use groovy script and couldn't find a way to do this.
Can someone help me with this?
Thanks
NS