Hey,
I have the following setup. I create a request which returns a JSON in the following format:
{
keyLayer1: value
collection: [{
keyLayer2: value,
collection: [{
keyLayer3: value
}]}]}
So I have nested collections. Now I want to save and reuse the value of the keyLayer3 but without specifying the collection indices. I would rather get a random element for each collection.
I did this
.check(jsonPath(“$. collection”).ofType[Seq[Any]].saveAs(“test”)))
and then for the other call I used the following to get the whole JSON item, but I then can’t extract more values or the collection inside the item.
${test.random()}
Any hints on how to extract the keyLayer3 by using random collection indices?
Thanks in advance.