Hey there,
I have an authentication service, returning auth-tokens for every login session (basically cookies).
I’m trying find a nice solution for gatling to deal with this.
My first approach was to repeat my auth call and save the returned tokens into an array:
`
val SessionIds = new ArrayString
object Auth {
val auth = repeat(10, “n”) {
exec(http(“auth”)
.get(“http://auth..org/login")
.basicAuth("user+${n}@.org”,“123456”)
.check(jsonPath("$.token").saveAs(“token”))
)
.exec(session => {
println(session(“token”).as[String])
session
})
}
`
The problem I’m facing is, that println prints the same token 10 times. Probably because of some internal concurrent executions?
So, my question is. What is the preferable way to do this?
Is there a better way, using a custom feeder? Any hints on that?
Best,
Tim