Apologies for this very basic question - I’m just getting started with gatling and trying to loop based on an expression, but I can’t work out how to make an Expression[Boolean] by comparing two string values.
Ok, so here’s the line which is giving me problems (I’ve checked that “current_status” is being set correctly by readStatus(…)):
I should probably include the error that I’m getting!
09:59:19.207 [GatlingSystem-akka.actor.default-dispatcher-9] ERROR io.gatling.core.session.LoopBlock$ - Condition evaluation crashed with message ‘Can’t cast value Succeeded == Running of type class java.lang.String into boolean’, exiting loop
.asLongAs(session => session(“current_status”).validate[String].map(_ == “Running”)) or
.asLongAs(session => session(“current_status”).as[String] == “Running”)
asLongAs condition is a session function that returns a boolean (http://gatling.io/docs/2.1.7/general/scenario.html)