Passing session variables between 2 scenarios

Hi All,

I have 2 scenarios in my gatling script. Both of these scenarios point to 2 different domain (baseurl), hence i cannot make them in same scenario.

A session variable captured in scenario 1, needs to be used in scenario 2. How can i accomplish this?

val Scenario1= scenario(“First Scenario”)


.exec(session => {
val String1= session(“Variable1”).as[String]
session.set( “String1”, String1)

val Scenario2=scenario(“Second Scenario”)
.get("${ String1}")

Scenario :

Scenario is waiting doing nothing as the first step is to use the variable captured in scenario1 to do rest of the steps. ${String1} in Scenario2 is not getting resolved.

Any help much appreciated. Thank you !

Hi Stephane,

Could you please comment if the above is even possible? If yes, is there any documentation that you can provide me?