Prad
August 19, 2022, 7:35am
1
Hi,
I have script with 2 groups - Launch, Login and I need to run them for 1 hour after the 2 users ramp-up of 1 minute.
val scn = scenario("Test").during(60.minutes)
{
.group("LaunchApplication")
(
exec(http("Launch")
.post("/url")
.body(StringBody("""{}""")).asJson)
)
.group("Login")
(
exec(http("Login")
.post("/url")
.body(StringBody("""{}""")).asJson)
)
}
setUp(scn.inject(rampUsers(2).during(60))).protocols(httpProtocol)
while running above scenario , I am getting compiler error as
value inject is not a member of io.gatling.core.structure.ChainBuilder =>
io.gatling.core.structure.ScenarioBuilder
Is there any other way I can achieve this workload execution.
NOTE - I have tried with forever(), and maxDuration(60.minutes) however, same issue.
Can someone please guide on this.
Thanks,
Prad
while running above scenario , I am getting compiler error as
The above scenario doesn’t compile because the dot on line .group("LaunchApplication")
has nothing to do here.
Prad
August 19, 2022, 9:05am
3
Even after updating group(“LaunchApplication”) still the compiler error persists.
Is there any other way I can simulate this by not putting .during(60.minutes) and directly updating setUp
Prad
August 19, 2022, 9:33am
4
Got this sorted with following step pattern , without adding “.during(60.minutes)”
setUp(scn.inject(rampConcurrentUsers(0) to (2) during(60),constantConcurrentUsers(2) during(60.minutes)))
.protocols(httpProtocol)
Nah.
The other compile errors you have is because you’re using parens instead of curly braces for wrapping your groups, but you’ve placed them on the next line, not on the same one.
group("LaunchApplication")(
exec(http("Launch")
.post("/url")
.body(StringBody("""{}""")).asJson)
)
Prad
August 19, 2022, 11:58am
6
Updated script with above change, with brace on the same line. Here the script is running and able to get required result.
However, on intelliJ seeing compiler error -
value inject is not a member of io.gatling.core.structure.ChainBuilder =>
io.gatling.core.structure.ScenarioBuilder