Question about error "value doWhile is not a member of io.gatling.core.structure.ScenarioBuilder"

Hi folks,

I am using gatling2.2.5 to simulate requests in a loop. The logic is: the client continuously sends requests to server; everytime server returns a token; the client will stop once it receives an empty string “” for token.

I use doWhile to implement the loop and here is the code snippet:

val scn = scenario(“FetchItemListInLoop”)
exec(http(“fetch items”)


However, I got the compiling error “value doWhile is not a member of io.gatling.core.structure.ScenarioBuilder”. Below is the error information:

11:51:11.658 [ERROR] i.g.c.ZincCompiler$ - **value doWhile** **is not a member of io.gatling.core.structure.ScenarioBuilder** possible cause: maybe a semicolon is missing beforevalue doWhile’?
11:51:11.661 [ERROR] i.g.c.ZincCompiler$ - .doWhile(session=>session(“token”).as[String].length()>0){
11:51:11.661 [ERROR] i.g.c.ZincCompiler$ - ^

I don’t understand why the compiler reports this error because I just followed the APIs in

Any help is greatly appreciated !!!