Skip to main content

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

NameType/ValueRequired
ExpressionExpressionYes

Expression: The condition that evaluates if the code must be executed or not.

Examples

if.jpg

if payload.success is equal to true then the code within the element is executed, otherwise is skipped.

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.