Loops use a session attribute counter underneath. If you don’t specify a name, Gatling will generate a random uuid.
You can use it just as any normal attribute.
In your example, it seems that counter is an externally defined variable (counter < 400), so that won’t work.
How about if you need to use a csv feeder?
I’ve also been reading the documentation but don’t actually know how to do it on my actual script.
Will this work?
val userCredentials = csv(“users.csv”).circular
val user_counter = userCredentials.records.size
val count = new java.util.concurrent.atomic.AtomicInteger(0)
Hi,
I want to add one condition in below scenario. Like I would like to exit from the scenario if counter=8 or WorkflowStatus=true
does anyone knows how to add increment counter variable and above condition in below scenario?
class LaunchResources extends Simulation {
val scenarioRepeatCount = Integer.getInteger("scenarioRepeatCount", 1).toInt val userCount = Integer.getInteger("userCount", 1).toInt val UUID = System.getProperty("UUID", "24d0e03") val username = System.getProperty("username", "p1") val password = System.getProperty("password", "P12") val testServerUrl = System.getProperty("testServerUrl", "[https://someurl.net](https://someurl.net/)")
val httpProtocol = http .baseURL(testServerUrl) .basicAuth(username, password) .connection("""keep-alive""") .contentTypeHeader("""application/vnd+json""")
val headers_0 = Map( """Cache-Control""" -> """no-cache""", """Origin""" -> """chrome-extension://fdmmgasdw1dojojpjoooidkmcomcm""")
what I really want to do is create a pattern like the image
I have several user groups that start when another group ends with similar configurations, what I want is to hold a group until a time and end suddenly, and then another group starts, this to not have at the same time the execution of two groups of virtual users
I’ve done this, but with the problem I’ve mentioned, in which two groups actually run for the same but short time, but ruins my pattern, this I’ve done with the command during(), but does not kill the groups but they wait to finish their flow, do not know if the image is seen in the overlap between two groups, what I really need is an example to end the flow of a group of users without waiting for them to finish, but that the simulation continues so that other groups do their thing.