Sequence Flow

Following commands allow you to control sequence flow

Basics

To be able to control test sequence flow you need to create labels within the test sequence. To do that enter a desired name in the label column. When using #call <label> and other commands the sequence will jump to the test step with the label

An example of using a label that can be called by sequence flow commands such as #call

#goto (Jump to label)

This command will jump to a test with specified label and continue the execution from there

Command Overview

Command
Parameter
#goto

<label-name>

Parameter Description

Parameter
Type
Options

label-name

[string]

Target label name to jump to. There is a special predefined label @this which represents the current row. This can be used to make the infinite main loop without defining any other label.

#call (Call a function)

This command will call a function (label) and expects a return value back. After the function is executed the sequence continues.

Command Overview

Command
Parameter
#call

<label-name>{:<param0>:....:<paramn>}

Call a function. Function is a block of code begins by the label and ends by the #return (or #throw) command. Typically the block should be placed outside the main program loop. The #call blocks the executing until subroutine is finished. The return value (#return of sub-routine) is written to Return Value.

Example

In this example you can see a test step that calls "ICT" label. When executed the section labeled ICT is executed until the #return command is reached. Aftert that the value of the #return parameter is written to return value of #call step and the test step is finished

Parameter Description

Parameter
Type
Options

label-name

[string]

Target label name to jump to

param

[string]

Optional parameter(s) to pass to target function. This parameter (s) will be stored to the "Return Value" of the called function. If there is more than one parameter, they will be stored to following lines, one parameter to one line, overwriting previous values. Line(s) with parameters name should be set to nonexecute, otherwise the parameter(s) in the "Return Value" will be overwritten by a command after step is executed. Default: (empty)

#return(Jump from function)

This command represents the end of the function block.

Command Overview

Command
Parameter
#return

{<return-value>}

Parameter Description

Parameter
Type
Options

return-value

[string]

Optional parameter, function can return a blank value. Otherwise this is any value to be returned by a function block. Default: (empty)

#throw(Exit function with error)

Return from function with an error. This will cause ReturnStatus = 1 at the place of function calling (using #call). If the async-called function is exited by #throw, the error is passed to #sync function. It is possible to return a custom error message or pass last caught error by #onerror functionality.

Command Overview

Command
Parameter
#throw

{<message>}

Parameter Description

Parameter
Type
Options

message

[string]

Optional error message to return from the function. If no message is passed, the #throw command will return the last error, caught by #onerror functionality.

#onerror, #onfail (Check for error or fail)

These commands enables to check for an error (means Return Status <> 0) or fail (means Judge is not empty and <> 0).

Note: On-fail action is not executed when the step ends with an error. If you want to treat both situations, you have to define behaviors for both on-fail and on-error (can be the same).

It is possible to: just set a number of retries of following step(s) perform a function call go to to a specified label

Command Overview

Command
Parameter
#onerror / #onfail

see below in examples

Examples

Command
Parameter

#onerror / #onfail

none

Disable the error or fail checking functionality.

Last updated

Was this helpful?