0
votes

Gatling documenation States:

Sequential Scenarios It’s also possible with andThen to chain scenarios so that children scenarios starts once all the users in the parent scenario terminate.

setUp(
  parent.inject(injectionProfile)
    // child1 and child2 will start at the same time when last parent user will terminate
    .andThen(
      child1.inject(injectionProfile)
        // grandChild will start when last child1 user will terminate
        .andThen(grandChild.inject(injectionProfile)),
      child2.inject(injectionProfile)
    )
)

But the code below does not compile:

      setUp(
    scenario("A").inject(atOnceUsers(1))
      .andThen(scenario("B").inject(atOnceUsers(1)))
  )

Compilation error:

     type mismatch;
 found   : io.gatling.core.structure.PopulationBuilder
 required: io.gatling.commons.validation.Validation[io.gatling.core.structure.PopulationBuilder] => ?
      .andThen(scenario("B").inject(atOnceUsers(1)))
                  

             ^

I'm using gatling 3.3.1

2

2 Answers

1
votes

Please check the milestone field on the ticket for this feature or the new features list: andThen was introduced in Gatling 3.4.0, so it's not available in Gatling 3.3.1.

1
votes

I found this feature : https://github.com/gatling/gatling/issues/3830

works in Gatling 3.4.0 :-)

Indeed I landed on 'current' documentation and didn't notice the feature is not present in 3.3: https://gatling.io/docs/3.3/general/simulation_setup/