Calls for conditional sub-scripts with Agilitest

Agilitest allows you to call so-called "conditional" subscripts, meaning that evaluating a condition leads to the subscript being called or not.

How to call conditional subscripts?

To perform this operation, you must first create a sub-script call action.

Then, click on the script call action and "Add condition".

add condition button

Then, select a variable on which a condition is based.

variable selection

This variable can be defined as “equal” or “different”.

Only one condition can be selected.

You can delete a defined condition by clicking on "Remove condition" from the script call action.

remove condition button

The other parameters for calling the subscript remain the same: you can pass input variables or a CSV file.

During the execution, Agilitest will evaluate the condition and, depending on the result, call or not call the sub-script using the defined parameters.

Agilitest will show you in the editor the result of the current state of the subscript call:

  • Green arrow: Subscript will be called
  • Stop sign: sub-script will not be called up
conditions passed or failed

🔸 Warning

For creation and maintenance, we recommend not using conditional subscript call functionality, to keep test campaigns as predictive as possible.

The cases in which we recommend using conditions are as follows:

  • Making a call based on the value of a global variable: this allows you to perform set-up operations based on the presence or absence of a variable in the continuous integration call parameters, for example.
  • In a subscript with a CSV file: call a script according to a CSV file parameter passed as a subscript call. This requires a second level of subscript, but allows you to manage dedicated controls.

Still require support?
Contact support