Dynamic content on webpage


I am wondering how can I force each virtual user to load different content on a given web page? Our homepage has a lot of dynamically generated content and when I run the script for 10 users, I see all of them are hitting same resource. Is there any way I can tell gatling to treat each user separately from the content perspective? I am using gatling 2 and my test run shows something like:

[--------------------------------------------------------------------------] 0%

waiting: 0 / running: 10 / done:0

---- Requests ------------------------------------------------------------------

Global (OK=530 KO=0 )

request_0 (OK=10 KO=0 )

css?family=Roboto+Slab:400,700 (OK=10 KO=0 )

minimalist.css (OK=10 KO=0 )

placeholder.js (OK=10 KO=0 )

21bea11fdb14fe30b112ed3ac93213d2-3:2-ty.jpg (OK=10 KO=0 )

f5463c54e96090f3020f2091615a0677-3:2-ty.jpg (OK=10 KO=0 )

ac6907985d2dfe4ba1e13206362fa27b-3:2-ty.jpg (OK=5 KO=0 )

jquery.flexslider-882.js (OK=10 KO=0 )

icon_time_anytime.png (OK=10 KO=0 )

46ffe1b454c2031a3b7bfd134cd94789-3:2-ty.jpg (OK=10 KO=0 )

jquery.cookie.js (OK=10 KO=0 )

fc77523f1226fe3be8816f4ed4652e62-3:2-ty.jpg (OK=10 KO=0 )

460fe0591015f62ae75c73ccecee1ee0-3:2-ty.jpg (OK=10 KO=0 )




Is there any way each of those 10 virtual user can load a different image?



Look into using the various forms of “switch” - random, round robin, etc. Then each user will take one path through the switch, so each user will be pulling a different resource.

However, what are you trying to accomplish, exactly?

Could you please provide some samples around using switch?

I am trying to load test a page with lots of dynamic content.

Thank you.


Search for randomSwitch

Thank you John for the pointer.

My script is extremely simple and don’t have any chains in it. Here is how it looks:

val scn = scenario(“HomePageSimulation”)





// .check(regex(“experiencing”).exists))

// .pause(5)

// setUp(scn.inject(atOnceUsers(30))).protocols(httpConf)

setUp(scn.inject(constantUsersPerSec(1) during(60)).protocols(httpConf))

Could you please tell me how can I use randomSwitch() here?

Thanks again.