Hello Group,
I’m trying to do an aslongas check that seems like it should be pretty simple, but it doesn’t seem to be working for me. Here’s the gist:
class Demo extends Simulation
{
setUp(
scenario(“Demo Start”)
.exec(.set(“rs”, “0”))
.exec(.set(“workflowGuid”, “D1O5KIBJo4BEB1Kt”))
.exec(Test.printSession)
.exec(Test.checkCallback)
.exec(Test.printSession)
.inject( atOnceUsers(1) )
)
}
object Test {
val checkCallback: ChainBuilder = asLongAs(session => session(“i”).as[Int] < 10 && session(“rs”).as[String] != “200”, “i”) {
exec(
http(“Look for callbacks”)
.get(Constants.callbackUrl + “?workflow_id=${workflowGuid}”)
.check(status.saveAs(“rs”))
)
}
val printSession: ChainBuilder = exec(session => {
session.foreach(print)
session
})
}
That outputs:
Session(Demo Start,1,Map(gatling.http.cache.dns → io.gatling.http.resolver.ShuffleJdkNameResolver@1f9ea9a7, rs → 0, workflowGuid → D1O5KIBJo4BEB1Kt),1529105538251,0,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$380/848102479@671ea959)16:32:18.353 [INFO ] i.g.c.c.Controller - InjectionStopped expectedCount=1
Session(Demo Start,1,Map(gatling.http.cache.dns → io.gatling.http.resolver.ShuffleJdkNameResolver@1f9ea9a7, rs → 200, workflowGuid → D1O5KIBJo4BEB1Kt),1529105538251,40,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$380/848102479@671ea959)16:32:20.340 [INFO ] i.g.c.c.Controller - All users are stopped