le_daim
le_daim

Reputation: 113

How to check if variable exists in a Gatling session?

In this question, an ObjectA creates a session variable, used in ObjectB

ObjectB will fail to execute if ObjectA fails to set the "GroupName" variable.

How to check in ObjectB context that session variable "GroupName" exists?

Upvotes: 1

Views: 2203

Answers (1)

James Warr
James Warr

Reputation: 2604

The gatling EL has support for checking if a variable exists in the session. so you can do something like this...

exec(ObjectA)
.doIf("${GroupName.exists()}") {
    exec(ObjectB)
}

Upvotes: 3

Related Questions