Subscript executions

▶️ You can also watch our tutorial on how to execute subscripts on our Youtube channel.

When a script is long enough, you can reduce it by creating a subscript.

Using subscripts will allow you to factorise the common functions of your tests, such as test data creation, login, regularly used operations, etc.

An additional advantage is that you can pass values as parameters to your subscripts, making your sub-scripts scalable and generic.

Finally, if you manage the granularity of your scripts and subscripts correctly, this will also enable you to have test scripts that are not too long, that are readable and easy to maintain.

Create a subscript

The subscript action has been designed to be scalable.

To create a subscript, select all the actions in your script that interest you. You can do so by pressing the CTRL key.

selecting actions

Then, drag and drop your actions on your ATS file.

dropping actions in the ats file

Finally, create your subscript by giving it a name.

create subscript

Your subscript will appear in your project explorer, as well as in the form of a script call action in the script from which the actions were extracted.

call the script action

Open a subscript

There are different ways of opening subscripts, even if they have different typologies such as multiple iterations, blocked, random, etc…

When you want to open the child script with the link to the parent, click on the "Execute action" button to open your subscript and execute it.

execute button

If your subscript contains parameters, they will appear in a small window displaying these parameters for a few moments during the execution.

parameters showing

To make these parameters reappear, click on the "\x" button at the bottom right of the screen.

button to show parameters

A subscript with only one iteration

In a subscript with a single iteration, if you click on the "Execute return values" button, it will return to the parent script.

execute return values button

The elements will no longer appear in your subscript but the parameters will remain in the subscript.

It is also possible to stop the link to the parent, so as not to return to the parent once the subscript has finished executing and to continue executing the script.

If you don't want this to happen, and simply run the subscript, simply click on the cross icon to cancel the return action.

cancel button

A subscript with several iterations

In a subscript with several iterations, the number of iterations will appear on the subscript call action line

subscript called 3 times

As well as at the bottom right of the execution of your subscript.

iterations count

If you click on the arrow once, it will move on to the next iteration with its parameters, and so on if you click on the arrow again.

arrow button

At the end of these iterations, as in the previous case, this button will be used to return to the parent.

You can also execute your iterations one after the other.

To do this, click on your editor's "Play" button in the channel management menu instead of executing the actions one after the other.

play button

This corresponds more to a mode of execution, compared with previous cases which corresponded more to creation or maintenance.

Still require support?
Contact support