I´m trying to use Gatling, where I just want to execute some steps in the first scenario iteration, here my code
def create(): ScenarioBuilder = {
scenario(name)
.exec(session => session.set("DEBUG", debug_set))
.exec(session => session.set("client_id", session.userId))
.doIf(session => session("initialized").asOption[String].isEmpty) {
exec(Identity.getIdentityToken)
exec(session => session.set("initialized", "true"))
}
.exitHereIfFailed
.during(Duration(15, MINUTES)) {
exec(X.setupVars)
.exec(X.create)
.pause(Duration(1, SECONDS))
.exec(X.get)
}
}
}
Somehow first iteration where initialized it´s not defined it´s not getting there, since I dont see the logs the execution of the one of the steps.
Any idea what I´m doing wrong?
One dot is missing for the second exec
in your doIf
:
.doIf(session => session("initialized").asOption[String].isEmpty) {
exec(Identity.getIdentityToken)
.exec(session => session.set("initialized", "true"))
}
Cheers,
Paul as well :)
Gatling Team
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With