Object Model Reference for GUI Testing > Utility Objects > Utility Statements > LoadAndRunAction Statement

LoadAndRunAction Statement

Description

Loads the specified action when this step runs, and then runs the action.

Use this statement when a static action call is not practical, or when you are not sure which action is going to be called. For example, you may use conditional statements that call external actions, and you do not want to load actions each time you open the test, since these actions may not be necessary during the run session.

Note: This statement is not supported in the Console Pane of the Debug panes.

Syntax

LoadAndRunAction(TestPath, ActionName, [Iteration], [Parameters])

Argument

Type

Description

TestPath

Variant

The path of the test containing the action. You can specify an absolute file system path, an ALM path, or a relative path.

ActionName

Variant

The name of the action.

Iteration

Variant

Optional.

-- oneIteration or 0 (Default)—Runs the action only once, using the row in the action's data sheet that corresponds to the global data sheet iteration counter.

If the action's data sheet contains fewer rows than the global sheet, the last row of the action's data sheet will be used for each subsequent iteration.

-- allIterations or 1—Runs iterations on all rows.

-- iteration row range (for example, "1-7")—Indicates the rows for which action iterations will be performed

Parameters

Variant

Optional.

The values and storage locations for the called action's input and output parameters. Input parameters are listed before output parameters.

For an input parameter, specify either a fixed value or the name of another defined parameter (data table parameter, environment parameter, or an action input parameter of the calling action) from which the argument should take its value.

For an output parameter, specify either a variable in which you want to store the value or the name of a defined parameter (data table parameter, environment parameter, or an action output parameter of the calling action).

Return Value

Variant.

If the action called by the LoadAndRunAction statement includes an ExitAction statement, the LoadAndRunAction statement returns the value of the ExitAction's RetVal argument. For more details, see ExitAction Statement.

IMPORTANT

The action is loaded only when the step runs (and not when the test opens). Therefore:

 

See also: