Hi All,
I am facing the below scenario and any solution would be really helpful.
- Need to get all values from a Single key multiple value Json response like the below one.
{“num”: 1, “templates”: [2285, 2293, 2310, 6638]}. I am able to successfully get it
using jsonPath("$…templates[0]") and Regex regex("\[(.*?)\]"). The total comma separated values of templates key changes dynamically.
-
But the problem is the resultant value when I took from the session and print in console it looks like this [2285, 2293, 2310, 6638], 2285, 2293, 2310, 6638 for Jsonpath and regex respectively.
-
I tried to use the Scala Split and tried to push it into an array but it is not working.
-
I need to get the value into an array and iterate the below request , depending on the total count with
.exec(http(“A”)
.get(url + “/${templates}/files/”)
.headers(templates)
.check(status.is(200))
Regards,
Aravind