Java - Migrating the test scripts from LoadRunner to Gatling

37 views
Skip to first unread message

Bharath Marrivada

unread,
Feb 14, 2022, 8:47:19 AM2/14/22
to Gatling User Group
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.




 

Stéphane LANDELLE

unread,
Feb 14, 2022, 8:54:40 AM2/14/22
to gat...@googlegroups.com
Hi,

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

Stéphane Landelle

Chief Technical Officer

   

slan...@gatling.io
gatling.io
   
facebook twitter linkedin 


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/febaa6ec-4514-44d9-8a5b-a8e19b166b27n%40googlegroups.com.

Bharath Marrivada

unread,
Feb 14, 2022, 1:01:25 PM2/14/22
to Gatling User Group
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.
Reply all
Reply to author
Forward
0 new messages