Gatling || .doif skips object execution

Hi Team,

Am trying to access an object based on some .doif validation. PFB

val scene1 = scenario(“scene1”)
.forever {

.doIf(session => session(“testCount”).as[Integer] > 0 && session(“testCount”).as[Integer] < 100)
{
exec(test1.action)
.exec(session => {
testCount = session(“testCount”).as[Integer] + 1
session.set(“testCount”,testCount)})
}

}

The problem here is :: Although testCount is getting incremented, its not executing exec(test1.action) object step . It skips this exec(test1.action) and continues with the increments.
FYI, All my logics are inside test1.action object.

Please help.

Thanks,
GBK

It’s probably something to do with the . before your doIf? Try removing it and running again…

Cheers,
Barry