I have the following objects as part of a scenario. Login, verification, flow and logout.
I want to run a test for 20 users(for example) for 10 minutes. I want all the 20 users to ramp up in the first 5 minutes and be in the system for the next 10 minutes. I want all 20 users to loop through verification and flow objects. In the last 5 minutes I want all the 20 users to execute the logout object.
1.I tried to create 2 scenarios like below. But did not know how to ramp down the users in the highlighted line below. I read some where that Gatling does not provide ramp down. Stephane told me that this is an incorrect way of defining scenarios.
val scn = scenario(“CoreScenarios”)
.during(2 minutes){
exec(Login.login, Verification.verification, Flow.flow,)
}
val scn1 = scenario(“Logout”).exec(Logout.logout)
setUp(
scn.inject(rampUsers(20) during (1 minutes)).protocols(httpProtocol)
.andThen(
scn1.inject(atOnceUsers(1)).protocols(httpProtocol))
)
- I tried to add .during{} to verification object. I know for the fact that verification object will run in a loop for the duration specified. But I want verification and flow objects together run in one single loop using ‘during’ and did not know how to achieve this?
I tried adding during{} outside of all the objects, but when I run the test, the objects are not getting recognized.