Hi people,
I’m quite new to scala and gatling and I’m trying to create a test scenario for the team I’m working with.
I’m currently facing this apparently simple procedure :
- Get a user/projectId from a csvFeed (done, quite simple)
- Call a Java library that generates an identifier for this user/project (done with an exec block)
.exec { session => val user = session.get("myUser").as[String] val identifier = RegistrationHelper.remoteRegister(user, user, session.get("projectId").as[String]) session.set("userId", identifier) }
- Later in the scenario (in a loop), call another Java library that generates some headers I need to pass to a GET (this is where I’m stuck) :
userId
I know this code cannot work because myHeaders variable cannot be accessed on the next exec call but this is to illustrate my need.
I’ve been struggling with that for days, I managed to avoid the trouble in other cases but here I don’t think I can.
Help me Gatling Community. You’re my only hope.
Thanks,
PG