Using andThen with ArraySeq of PopulationBuilder

Hi,

I am facing an issue when I am running Sequential scenarios.

e.g. I have three scenarios scn1, scn2, scn2. I want to execute scn1, and scn2 first and then scn3 at the end.

I have ArraySeq of PopulationBuilder which works perfectly fine when I am running standalone tests without using the andThen feature.

def scn(scnName: String, scnBuild: ScenarioBuilder, scnUser: Int): ScenarioBuilder = scenario(scnName + " VUsers: " + scnUser).repeat(NoOfIteration, "iterationNumber") {
  exec(scnBuild)
}

val stepsI: mutable.ArraySeq[PopulationBuilder] = new Array[PopulationBuilder](scnNameArr.length)

for (i <- scnNameArr.indices) {
  val scnUser: Int = Random.nextInt(10)

  stepsI(i) = scn(scnNameArr(i), scnNameArr(i), scnUser).inject(
    rampUsers(scnUser) during (scnUser seconds)
  )
}
stepsI


When I am running the below setUp it’s working fine:

setUp(stepsI.toSeq: _*).protocols(myProtocol)

But when I am trying to use andThen feature it’s not getting recognized, below is the setup that I am trying to achieve:

setUp(
  stepsI.toSeq: _*
    .andThen(/*here is my child scenario injection*/)
).protocols(myProtocol)

when I mouse hover to andThen it says Cannot resolve overloaded method ‘andThen’

Please help!

Thanks & regards,
Raman


That’s not possible atm.

Sorry, but I didn’t get you.

Am I doing something wrong or not possible in Gatling?

I am using Gatling 3.6.0 version.

Hi Stéphane,

Just wanted to check if it’s not possible with latest Gatling version or am I doing something wrong?

If it’s not possible with Gatling then any plan to add the support of this in future release?

Thanks & Regards
Raman