Call one test from another test

All the Actions in a script can be called separately but not the entire script

It is not possible to call a complete script from another script. Only reusable actions from within a script can be called from another test. You can insert a call to one action at a time. This way if your script has three Actions, you do not have to execute all the Actions and can select which one to call.

You can simulate calling a complete test by nesting the actions in a main action, then calling the main action from another test.

1. In the original test, insert a new action (Insert -> Call to New Action).
2. Change the action’s name to a meaningful name. For example, FindFlightActions.
3. Move the original actions into the new action, so they are nested.

The original test contains three sibling actions, EnterDate, EnterLocations, SelectFlight. Move them so they are called from within the new FindFlightActions action:

|- EnterDate
|- EnterLocations
|- SelectFlight

4. Make the FindFlightActions and all its child actions reusable.
5. In the new test, insert a call to the FindFlightActions reusable action (Insert -> Call to Existing Action).

Nesting reusable actions may modify some behavior when working with the data table. Before applying permanent changes to the script, you may want to make a backup of the script and test the replay behavior.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s