Use action and test parameters
Relevant for: GUI tests only
To pass parameter values from a test to an action, from a parent action to a nested action, or from one action to another, you must create parameters in each test or action, and link those parameters to each other.
Prerequisite - Create test parameters
You must create test parameters to use test parameters in actions or to pass parameters between actions:
-
In the canvas, select the Start or End step.
-
In the Properties pane, open the Parameters tab .
-
Click the Add button and select Add Input Parameter or Add Output Parameter.
-
In the parameters grid, enter the parameter details and click OK.
Default values are optional, and are only used if no value is provided through other sources.
The parameter is added under the Input or Output Parameters list in the Parameter tab and is available to use in your test.
Note: Before each test run, you set the parameter value either in the Properties pane (with the Start or End step selected) or in the Run dialog box.
Use a test input parameter in a top-level action
You can use the test parameter value as the action parameter value in an action by passing the test parameter to the action parameter.
-
Create a test input parameter.
Follow the instructions in Prerequisite - Create test parameters.
-
Create an action input parameter in a top-level action.
-
In the canvas:
Right-click the action and select Action Properties.
-
In the Parameters tab of the Action Properties dialog box:
In the input parameters list, click Add parameter and enter the parameter details.
-
-
Link the action parameter to the test parameter.
-
In the canvas:
Right-click the action and select Action Call Properties.
-
In the Parameters tab of the Action Call Properties dialog box:
In the input parameter's row, click the Default Value cell and then click the Configure button in this cell.
-
In the Value Configuration Options dialog box that opens:
Select the Parameter option, select Test/action parameter from the list, and then select the relevant test parameter.
After you click OK, the canvas shows the link between the test parameter and the action parameter.
-
When you run the test, the test input parameter value is available for use in the action parameter.
Use a test or action input parameter in a nested action
To use the value of a test or action input parameter in a nested action, you need to create parameters in the test and the actions and link them to each other.
Use the following process to link any action input parameter to a test parameter to provide the parameter values:
-
Create a test input parameter.
-
Create an action input parameter in the parent action.
-
(Optional) To use the test input parameter value in the nested action, link the parent action's parameter to the test parameter.
-
Create an action input parameter in the nested action.
-
Link the nested action's parameter to the parent action's parameter.
For detailed instructions on creating and linking parameters, see Use a test input parameter in a top-level action.
When you run the test, the action input parameter receives its value from the value of the test parameter and the parent action. Likewise, any test steps in the nested action that are linked to the nested action parameter receive the same value.
Use an action input parameter in a sibling action
To use an input parameter from one action in a sibling action, you must link the passing action parameter to a test parameter and then link the test parameter to the receiving (sibling) action parameter.
After you link the passing action's parameter to a test parameter, you can use the parameter in multiple sibling actions.
Repeat the following process as many times as you need when you want to use the input parameter of an action as an input parameter in another action:
-
Create a test input parameter.
-
Create an action input parameter in the passing action.
-
Link the action input parameter to the test input parameter.
-
Create an action input parameter in receiving action.
-
Link the receiving action input parameter to the same test input parameter.
The passed input parameter is available to use in the steps in the receiving action.
Use a nested action output parameter as a parent action or test output parameter
To use the output parameter of a nested action in the parent action or as a test output parameter, you must store the nested action output parameter in the parent action output parameter and then (if necessary) store the parent action output parameter in the test output parameter.
Use the following process to link a nested action output parameter to a parent action parameter and test output parameter to use the value outside the action:
-
Create a test output parameter.
Follow the instructions in Prerequisite - Create test parameters.
-
Create the output action parameter for the parent action.
-
In the canvas:
Right-click the action and select Action Properties.
-
In the Parameters tab of the Action Properties dialog box:
In the output parameters list, click Add parameter , and enter the parameter details.
-
-
Similarly, create an output action parameter for the nested action.
-
Store the output parameter from the nested action in the output parameter of the parent action:
-
In the canvas:
Right-click the nested action and select Action Call Properties.
-
In the Parameters tab of the Action Call Properties dialog box:
In the output parameter's row, click the Store In cell and then click the Configure button in this cell.
-
In the Storage Location Options dialog box that opens:
Select the Output Type option, select Test/action parameter from the list, and then select the relevant action parameter.
-
-
Similarly, store the parent action's output parameter in the test's output parameter.
The canvas shows the links between the test parameter and the action parameters.
The nested action's output parameter value is now available for use in the parent action and as a test output parameter.
Use a step output value as an action or test output parameter
To use a step output value as an action or test output parameter, you must store the step output value in the action's output parameter, and then (if necessary) link the action output parameter to the test output parameter.
-
Create an output action parameter in the action containing the step. For details, see Use a nested action output parameter as a parent action or test output parameter.
-
Create an output value step in your action, and store its value in the action parameter:
-
Right-click a step in your test and select Insert Output Value.
-
In the Output Value Properties dialog box that opens, select a property in the table, and then click the Modify button in the Configure Value area to assign the storage location for the output value of the step.
-
In the Storage Location Options dialog box that opens, select the Output Type option, choose Test/action parameter, and select the output parameter for the action containing the step.
-
-
(Optional) To use the test input parameter value in a parent action or in a test output parameter, store this action's output parameter in those output parameters. For details, see Use a nested action output parameter as a parent action or test output parameter.
When your step runs, the output parameter from the step is used as the output parameter for the action or test.
Use an output parameter as the input parameter of another action
To use the output parameter of a action as the input parameter of another subsequent action, you must link the input parameter to the output parameter of the previous action.
-
Create the action output parameter for the passing action:
-
In the canvas:
Right-click the action and select Action Properties.
-
In the Parameters tab of the Action Properties dialog box:
In the output parameters list, click Add parameter and enter the parameter details.
-
-
Similarly, create the action input parameter for the receiving action in the action's input parameters list.
-
Link the value of the receiving action's input parameter to the output parameter of the passing action:
-
In the canvas:
Right-click the receiving action and select Action Call Properties.
-
In the Parameters tab of the Action Call Properties dialog box:
In the input parameter's row, click the Default Value cell and then click the Configure button in this cell.
-
In the Value Configuration Options dialog box that opens:
Select the Parameter option, select Test/action parameter from the list, and then select Output from previous action call(s).
-
Select the passing action and the parameter whose value you want to use.
-
When the test runs, the value of the output parameter from the passing action provides the value for the input parameter of the receiving action.
Likewise, any test steps that use the parameter receive this same value.
Use the action parameters from an action call
When you insert an action call, you can pass and use parameters from the test or other actions in the same way described in the steps above. When choosing the link source for parameters, you can also choose from the original test or action parameter values or the test and action parameter values in the test containing the action call.
Use the parameter values in a test step
Once you have passed the parameter value to the appropriate action, it is then available to use as a parameter value in any test step. For details on using parameters in test steps, see Parameterize values for operations or local objects.