step 1 : I am getting one variable in response of one API call which I stored in one variable
* def ID = response.id
step 2 : In the second API call, response is the array of json object with multiple fields, after post method response I am trying to pass 'ID' inside if condition and based on if condition I am expecting array ( which is coming empty) example response of API [ {city: "NY", code:41049, id: ABC-123, name: "USA"},{city: "OT", code:42049, id: ABC-123, name: "CANADA"}
- def idarray = [] And eval for(var i=0;i<response.length;i++) if (response[i].id == '+ ID +' && response[i].name == 'USA') idarray.add(response[i].cityname) Then print idarray ( getting null value)
step 3: I want to pass step 2 printed array value of specific index in next API call urlpath (I am trying like)
And path dynamicform/'+ idarray +'/form1 ( getting null value here for +idarray+) when method get then status 200