If
Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.
Allows you to run a specific piece of code only if a specific condition is met.
Parameters
Name | Type/Value | Required |
---|---|---|
Expression | Expression | Yes |
Expression: The condition that evaluates if the code must be executed or not.
Examples
![if.jpg](/img/api-fortress/2020/12/if.jpg)
if payload.success
is equal to true then the code within the element is executed, otherwise is skipped.
![ifexists.jpg](/img/api-fortress/2020/12/ifexists.jpg)
if _1.intermediate
exists then the code within the element is executed, otherwise is skipped. This is useful when the element is not always present.