Java - Migrating the test scripts from LoadRunner to Gatling

Hello Stephan,

In LoadRunner, there are actions (Block of code) as shown below
vuser_init() //This contains login code and is executed once at the beginning.
Action1 //Action1 to Action3 iterate continuously
Action2
Action3
vuser_end() //This contains Logout code and is executed at the end of the test.

In the same way, I have created Actions in Gatling using ChainBuilder as shown below
login
Action1
Action2
Action3
Logoff

I am able to build a scenario as shown below, but it gets executed one time only.
ScenarioBuilder fileupload_users = scenario(“Users”).exec(login,Action1, Action2, Action3, Logoff);

Any suggestions on how to run Login and Logoff once?
Action1, Action2, Action3 continuously till the duration of the time specified.

I tried using “repeat”, don’t want to repeat each Chain individually, all the chains are to be repeated sequentially.

Regards,
Bharath.

Hi,

Wrap the desired sequence in a during loop: https://gatling.io/docs/gatling/reference/current/core/scenario/#loop-statements.

Thank you, Stephan.
I was looking for this https://gatling.io/docs/gatling/tutorials/advanced/#step-4-looping , this can help me build a modular code. I can define all the functions in a separate class file and call them into the main class.

Regards,
Bharath.