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