Conditional execution of steps

Hello,

I’m trying to use the following setup. In the simulation I have numerous steps and the execution of some of them depend on the successful execution of a previous one. How can I skip a block of steps if one step has failed? For example if get has failed, I want to skip the next 2 steps.

object Agent {

val login = exec(http(“Login agent”)
.post("/login")
.body(…)
.check(jsonPath("$.result…id").ofType[String].saveAs(“agentId”))
)

val get = exec(http(“Get agent”)
.post("/get")
.body(${agentId})
)
}

You can use doIf, for ex. get response code from request 1 and then if it is 200 or your any condition do next block
http://gatling.io/docs/2.2/general/scenario/