Combine condition

Hello
I want to simplify this code, is there a way to use something like “&&” ?

                .doIf("#{unexpected_item_id.isUndefined()}").then(
                    doIf("#{po_item_id.isUndefined()}").then(
                        doIf("#{elect_item_id.isUndefined()}").then(

                        )
                    )
                )

You can’t use Gatling Expression Language for this, but you can use a function and the Session API:

.doIf(session -> !session.contains("unexpected_item_id")
                             && !session.contains("po_item_id")
                             && !session.contains("elect_item_id")
).then(

                )
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.