Agilitest allows you to call conditional sub-scripts, that is, the evaluation of a condition leads to the call or not of the sub-script.
How to call conditional sub-scripts
To perform this operation, you must create a sub-script call action beforehand.
Then, click on "call script" then "create a condition".
Agilitest then displays a selection popup of a variable on which the condition is based, which must be a tie.
Only one condition can be selected, and it is possible to remove a defined condition by re-clicking on "call script".
During execution, Agilitest will evaluate the condition and, depending on the result, it will call or not the sub-script using the defined parameters.
For now, only equality has been proposed as a condition, and Agilitest will show you in the editor the result of the current status of the call of sub-scripts :
- Green arrow: the sub-script would be called
- Sense-forbidden: the sub-script would not be called
We advise you to use this function with a lot of precautions, because it will allow you to integrate non-genericity in your tests, and therefore potentially malfunction related to uncontrolled data.
The cases for which we recommend it are the following :
- Make a call based on a global variable value, this allows you to perform set-up operations based on whether or not a variable is present in the call parameters of continuous integration for example.
- In a sub-script with a CSV file: call a script according to a parameter of the CSV file passed in sub-script call, this requires you to have a second level of sub-script, but allows you to manage dedicated controls.