How to use an array object in the request and iterate
Can someone help please ?
From JSON response below I'm able to get the values of "Name" element and write it to a property variable "xy"as a string using below groovy step, however I do not know how to pass the [] value from the Property to the JSon request as an URL parameter ? second part is I want to iterate the request dynamically based on how many Name(s) are getting returned in the response and assert accordingly, any quick help is much appreciated, thanks for reading.
Groovy Step
def prop1 = context.testCase.getTestStepByName("TestData")
prop1.setPropertyValue("Name",Name.toString())
Output of above step set in property ..
Name = [UnitApplication,WebUI ]
JSON Response
[
{
"Id": 1,
"Name": "UnitApplication",
"APIKey": "e28de5d0-39ce-4a4c-90b0-fe9a95d02021",
"AssemblyId": null,
"Distributore": null,
"Configuration": null,
"Set": [],
"Rou": [],
"Pattern": []
},
{
"Id": 2,
"Name": "WebUI",
"APIKey": "74e162cb-9872-4a1b-bd94-72aa4b6e44ca",
"AssemblyId": null,
"Distributor": null,
"Configuration": null,
"Settings": [],
"Routes": [],
"Pattern": []
},