Switch

The Switch block compares the Input value to the cases values using comparison methods such as “equals” or “less than or equal to” and others. The block enables branching of automation flows. Fully expanded, the Switch block shows the following properties:

switch

The Block Header (“Switch”)

The green input connector in the header is used to trigger the block to start executing.

Each case has a green output connector triggered if the comparison method specified was met.

The title of the block (“Switch”) can be changed by double-clicking on it and typing in a new title.

Input

The value to use in the comparison. It can be typed in the field or fed as input from the previous block.

Add case

Add case (branch) to compare to the input field. LEAPWORK will execute the first case branch that meets the comparison method specified.

No match

Triggers when the comparison results in an unsuccessful or false outcome, when none of the cases meet the comparison method.

Comparison method

Select which comparison method to use (Equal, Not equal, Greater than, Greater than or equal, Less than or Less than or equal).

Comparison type

Select which data type to use for the comparison. Values are automatically converted to appropriate data types, but in certain cases it can make sense to select which type to use.

Choosing the wrong comparison type can have unforeseen consequences, so choose carefully. For instance, comparing the text “200,200” with the position 200,50 results in false, but comparing position 200,200 with position 200,50 results in true.

Updated April 20th 2018.