Save random value from list

Hello,

I have values list and I need just one random value and use it several times.

For example,

val scn = scenario(“SimpleScen”)
.exec(http(“users”)
.get("/users")
.check(jsonPath("$[*].id").findAll.saveAs(“allUsers”)))

.exec(http(“projects”)
.get("/projects?&userId=" + “${userID}”)
)

.exec(http(“payments”)
.get("/payments?&userId=" + “${userID}”)
)

I know that I can get random value “${userID.random()}”, but I need the same value to use both times. How can I save it?

Thanks,

Aiste

  • Random value can get from “${allUsers.random()}”