rohitvarsha12
8 years agoContributor
How to Save Json Child Node Count
In below JSON response I want to find out how many times items are present in itemlist ( In this case 3):
{
"bio": {
"firstName": "abc",
},
"itemList": [
{
"creditorName":"1"
},
{
"creditorName":"1"
},
{
"creditorName":"1"
}
],
"validationMessages": []
}
How can i find it out using groovy or if soap ui pro has in built feature anything will do
- Ok, because you may need to look at a solution and change the script accordingly.
Have a look at here which is a similar case:
http://stackoverflow.com/questions/34008866/groovy-json-how-to-get-the-length-of-an-array-from-json