Trying to set up a Gatling Scenario similar to a LoadRunner Scenario

In LoadRunner, I can set up a test where I ramp up users to reach 500 concurrent users, then stay at that level for 20 minutes — running continuous iterations over that period. Each user only logs in one time, but continues to work over the 20 minute period.

The application being tested is a quite common design at Deere — A portal type application in which a Dealer logs into a system and stays logged in over long periods of time, performing various business activities.

Typically I would have a ramp up rate of 10 users every 15 seconds until I reached 500, so the total test run time would be 32 minutes and 30 seconds.

How can I set up this type of scenario in Gatling?

I thought I would do something like this:

First, I put a .repeat in the scn section of my script:

val scn = scenario("DealerPathUC1") .feed(csvSAMLResponseFeeder) .feed(csvDealerFeeder) .exec(Access_Site()) .pause(5 seconds) .exec(Login()) .pause(5 seconds) .repeat(10)( exec(BusinessAdmin()) .pause(5 seconds) .exec(SupplierDiscounts()) .pause(5 seconds) .exec(ShopAtJDIS()) .pause(5 seconds) .exec(MyDealerPath()) .pause(5 seconds) .exec(PartsAndAttachments()) .pause(5 seconds) .exec(BarCodeInformation()) .pause(5 seconds) .exec(ShowroomProcessOptimization()) .pause(5 seconds) .exec(MyDealerPath2()) .pause(5 seconds) .exec(ServiceAndSupport()) .pause(5 seconds) .exec(MyDealerPath3()) .pause(5 seconds) .exec(Sales()) .pause(5 seconds) .exec(PriceBooks()) .pause(5 seconds) .exec(MyDealerPath4()) .pause(5 seconds) .exec(MarketingAndAdvertising()) .pause(5 seconds) .exec(eLeader()) .pause(5 seconds) .exec(MyDealerPath5()) .pause(5 seconds) )

And then I set up the injection schedule:

setUp( scn.inject( constantConcurrentUsers(500) during (20 minutes), rampConcurrentUsers(10) to (500) during (13 minutes) ) ).protocols(httpProtocol)

But this does not behave as I would understand the syntax in Gatling.

I have tried to find others with similar scenario design questions, but apparently I am not getting a good understanding of things.

Thanks,
Randy

I ramp up users to reach 500 concurrent users, then stay at that level for 20 minutes — running continuous iterations over that period. Each user only logs in one time, but continues to work over the 20 minute period.

rampUsers(500) during(13 minutes)

have a during loop after initial login that lasts 33 minutes

either abruptly stop test after 33 minutes with maxDuration, or let users ramp down naturally.

Thank you, as usual, Stephane.

I still feel like I am beating my head against the wall at times, but you help ease at least some of my pain.

Randy

In Gatling, injection profiles only control when users are started either based on arrival rate (open model) or concurrent users (closed model).
Users lifespans only depend on their scenario.

Hope it helps,

Hi Stéphane Landelle ,

Please confirm whether I understood your statement correctly regarding this discussion.
You are saying that we can’t forcefully achieve ramp down by making the Vusers exit as per the syntax.
And also if we want to stop the test we can use maxduration but there won’t be any ramp down when we see in the report of index.html file.

Regards,
Aravind Ganesan

Exactly

Thanks Stéphane , then it solves the query which I asked separately in this group. I will post this conversation thread there.