Response:
[
{"msisdn":"85237009372","name":"Vicky","carrier":"AIRTEL"},
{"msisdn":"85237009373","name":"Vicky1","carrier":"AIRTEL"}
]
I want to extract the all name from response and assign it to array/list?
Code:
import groovy.json.JsonSlurper
// Retrieve valid mptu Amounts from GET mptu-amounts response
context.responseContent = context.testCase.getTestStepByName("xxxx").getPropertyValue("r_responseContent")
try
{
responseContentParsed = new JsonSlurper().parseText( context.responseContent )
context.mptuValidAlias = responseContentParsed.name[0]
log.info(context.mptuValidAlias)
}
It is retrieving the first row, name (i.e) vicky only.. i wanted to extract name of all rows and assign it to list.. How to do this?