如何检查 Gatling 会话中是否存在变量?

How to check if variable exists in a Gatling session?

中,一个ObjectA创建了一个会话变量,在ObjectB

中使用

如果 ObjectA 未能设置 "GroupName" 变量,ObjectB 将无法执行。

如何在 ObjectB 上下文中检查会话变量 "GroupName" 是否存在?

gatling EL 支持检查会话中是否存在变量。 所以你可以做这样的事情...

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