Hi. I’ve been using Gatling for 2 months and I’m a bit stuck with what seems to be a simple problem. I’m new to scala.
I have such a program code. But I don’t understand why, the condition inside “IF” is not met. At the same time, the output to the “println” log works.
How to make “exec” run inside “if”?
.group("_UC20")(
exec { session =>
val city_proc = session("city_proc").as[String]
val street_proc = session("street_proc").as[String]
val building_proc = session("building_proc").as[String]
if(city_proc != session("deliveryCity") || street_proc != session("deliveryStreet") || building_proc != session("deliveryNumberHome")) {
exec(LightBuyWithPromAction.api_v3_addresses_reduce_short_address)
.exec(LightBuyWithPromAction.api_shopping_context)
println("city_proc", session("city_proc").as[String])
println("street_proc", session("street_proc").as[String])
println("building_proc", session("building_proc").as[String])
} else {}
session
}
)
At the same time, when the output to the log is triggered, it does not execute “exec”, but goes further along the program code and executes the next group “group”.