how to run multiples scenarios with 3(specific number ofusers) users for a period of 1hour(a specific period) in gatling

I have a testc ase where I need to run a series of scnearios for 1 hour. How do we specify this in gatling. Please see the simulation set up below.

setUp(scn1.inject(rampUsers(3) over(30 minutes)),
scn2.inject(rampUsers(3) over(30 minutes)),
scn3.inject(rampUsers(3) over(30 minutes)),
scn4.inject(rampUsers(3) over(30 minutes)),
scn5.inject(rampUsers(3) over(30 minutes)),
scn6.inject(rampUsers(3) over(30 minutes)),
scn7.inject(rampUsers(3) over(30 minutes)),
scn8.inject(rampUsers(3) over(30 minutes)),
scn9.inject(rampUsers(3) over(30 minutes)),
scn10.inject(rampUsers(3) over(30 minutes)),
scn11.inject(rampUsers(3) over(30 minutes)),
scn12.inject(rampUsers(3) over(30 minutes)))

I want all the scenarios to be run with 3 users and for a duration of 30 minutes. Please see the simulation file attached.

I would like to run my scenarios with standard users of 3 for a period of 1 hour. How can I do this in gatling?

largefiletest2.scala (16 KB)

“I want all the scenarios to be run with 3 users and for a duration of 30 minutes.” = closed model = atOnceUsers(3) + during(30 minutes) loop wrapping your scenario.


you mean to say I should define the scenarios as below

setUp(scn1.inject(atOnceUsers(3) during(30 minutes)),
scn2.inject(atOnceUsers(3) during(30 minutes)),
scn3.inject(atOnceUsers(3) during(30 minutes)),
scn4.inject(atOnceUsers(3) during(30 minutes)),
scn5.inject(atOnceUsers(3) during(30 minutes)),
scn6.inject(atOnceUsers(3) during(30 minutes)),
scn7.inject(atOnceUsers(3) during(30 minutes)),
scn8.inject(atOnceUsers(3) during(30 minutes)),
scn9.inject(atOnceUsers(3) during(30 minutes)),
scn10.inject(atOnceUsers(3) during(30 minutes)),
scn11.inject(atOnceUsers(3) during(30 minutes)),
scn12.inject(atOnceUsers(3) during(30 minutes))).

when I did that it gives the following error

value during is not a member of io.gatling.core.controller.inject.AtOnceInjection

22:21:34.791 [ERROR] i.g.c.ZincCompiler$ - setUp(scn1.inject(atOnceUsers(3) during(30 minutes)),

Please can you correct the attachment I have posted .




Please read the documentation and search for “during” loop.