doIfOrElse cannot resolve symbol

Hello,

Can you please explain why am i getting “Cannot resolve symbol” error on doIfOrElse in the following scenario:

val scn = scenario(“Revoke client token”)
.exec(getadmintoken)
.doIforElse((session:Session) => session.contains(“clientid”))
{
exec((s:Session)=>{
PrintSessionParam(“clientid”, s, “The value of client id is +++++++++++”)
val id = s(“clientid”).as[String].toInt + 1

val newsession = s.set(“clientid”, id.toString)
newsession
})
}{
exec((s:Session)=>{

val newsession = s.set(“clientid”, clientid.toString )
newsession
}
)
}

I have bootstrap imported.

Using Gatling 2 M3a

Thanks!

doIforElse : typo => doIfOrElse

Also, can somebody please explain why am i getting “key not found: clientid” when trying to set the value in session

Are you sure you didn’t mess up when trying to disable the line that didn’t compile and ended up reaching a branch where is clientid hasn’t been set?

Hi Stephane,

Thanks for reply.

My bad, sorry for this.

GerraldG