value maxDuration is not a member of io.gatling.core.structure.Populate dScenarioBuilder

Following error identified when i am trying to use the maxDuration in Simulation setup.

setUp(
users.inject(rampUsers(10) over (10 seconds)),
// admins.inject(rampUsers(2) over (10 seconds))
admins.inject(rampUsers(2) over(10 seconds)).maxDuration(3 minutes)
).protocols(httpConf)

Error description:

C:\gatling-charts-highcharts-bundle-2.1.7\bin>gatling.bat
GATLING_HOME is set to “C:\gatling-charts-highcharts-bundle-2.1.7”
11:05:10.033 [ERROR] i.g.c.ZincCompiler$ - C:\gatling-charts-highcharts-bundle-2
.1.7\user-files\simulations\computerdatabase\advanced\AdvancedSimulationStep05.s
cala:75: value maxDuration is not a member of io.gatling.core.structure.Populate
dScenarioBuilder
11:05:10.048 [ERROR] i.g.c.ZincCompiler$ - admins.inject(rampUsers(2) over(1
0 seconds)).maxDuration(3 minutes)
11:05:10.048 [ERROR] i.g.c.ZincCompiler$ -
^
11:05:10.126 [ERROR] i.g.c.ZincCompiler$ - one error found

Could you please have a look and advise,

maxDuration is only available on the set up (global to the whole simulation), not per scenario. See doc.

Thank you Stephane, I will check and enhance the code accordingly.

Hi Srinivas,

Does maxDuration worked?

I am unable to do it, could you please posted some code how to use maxDuration?

Thanks in advance.

KR,
Sravan