I am trying to parse a json response and get all the instances of specific key. I want to randomly extract one of the value for that key in my next request. Currently I am getting Map and have to specifically select the value from that map. Can I randomize it.
My Code:
.check(jsonPath("$.entries[*].id").findAll.saveAs(“id”))) ----> This returns all “id” present under “entries”, like Map(id → Vector(id1, id2, id3, id4, id5,…)).
I would like to randomly pick up any of those id’s returned above in my request, instead I am currently specifying it like shown below:
.get("/nextRequest/${id(3)}")
Would it be possible to randomly assign id in above request instead of ${id(3)}.
i need to extract the ids from response in an array where 1 id having null value i need to ignore that “null” value and save other ids and pass to next request randomly.