Gatling DSL components are immutable ActionBuilder(s) that have to be chained altogether and are only built once on startup. The results is a workflow chain of Action(s). These builders don’t do anything by themselves, they don’t trigger any side effect, they are just definitions. As a result, creating such DSL components at runtime in functions is completely meaningless. If you want conditional paths in your execution flow, use the proper DSL components (doIf, randomSwitch, etc)
exec { session => if (someSessionBasedCondition(session)) { // just create a builder that is immediately discarded, hence doesn't do anything // you should be using a doIf here http("Get Homepage").get("http://github.com/gatling/gatling") } session }
--
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.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
val endNum = 5
val startNum = 1
var counter = new java.util.concurrent.atomic.AtomicInteger(startNum-1)
val httpProtocol = http
.baseURL("http://demo.mockable.io/")
val scn = scenario("+1")
.asLongAs(session => counter.getAndIncrement() < endNum)
{
exec(http("Change_Password")
.get(session =>"http://demo.mockable.io/" + s"""${counter}""")
.check(status.is(404))
)
}