Save random value from list

13 views
Skip to first unread message

Aistė Šimkutė

unread,
Sep 19, 2016, 6:07:17 AM9/19/16
to Gatling User Group
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
Message has been deleted

Aistė Šimkutė

unread,
Sep 19, 2016, 8:27:32 AM9/19/16
to Gatling User Group
* Random value can get from "${allUsers.random()}"
Reply all
Reply to author
Forward
0 new messages