** Using Gatling 2.1.4 on Ubuntu 14.10
I have a scenario where I create a workspace (context) as user1 and after I create that workspace I want to assign a randomly chosen different user to that workspace from the same feeder file. How would I randomly choose another user from that same feeder file?
This is the format of my feeder file:
login-user-name,login-password,account-urid,access-token,mac-key
gatling1,password,[https://server.com/resources/data/accounts/c945b1f0-c106-11e4-86b1-695fd0c942fc,69be32d8-45c9-4c77-a49b-c245b1b0be27,L5V3GcR1UdXns4sAS6hH](https://server.com/resources/data/accounts/c945b1f0-c106-11e4-86b1-695fd0c942fc,69be32d8-45c9-4c77-a49b-c245b1b0be27,L5V3GcR1UdXns4sAS6hH)
This is what my scenario looks like:
object CreateWorkspaceScenario extends BaseScenario {
val mainScenario = scenario("create-workspace-scenario")
.group("create-workspace-group") {
feed(calculatedUsersFeederFile.circular)
.exec(SetSessionTokenAndMacKeyModule.execute)
.exec(session => { val newSession : Session = session.set("context-request-name", "create-workspace-request")
.set("context-type", "COLLABORATION")
.set("context-label", session("login-user-name").as[String] + "-" + UUID.randomUUID() + "-Workspace")
newSession})
.exec(CreateContextRequest.postRequest)
}
}
I am going to be adding another request at the end called AssignUserToWorkspace and in that I need a randomly chosen user other than the “login-user-name” from the same feeder file that is already in that session.
Thanks,
Steve