Use actions in an API test
Relevant for: API testing only
This topic describes how to use actions in an API test.
Create a new action
-
Select Design > Call to New Action.
-
Specify the action name and description. Click OK to add the call to the action to the canvas.
-
In the Solution Explorer, double-click the action to open its canvas.
-
Add steps to the action. Drag activities from the Toolbox onto the canvas.
Note: You can insert a call to another action, from an existing action call.
Call an existing action or a test
-
From the Toolbox pane, expand the Micro Focus Automated Testing Tools node and add a Call API Action or Test or Call GUI Action or Test to the canvas.
-
In the Properties Pane, Open the Input/Checkpoints tab .
-
In the Input/Checkpoints tab, click the Select Action or Test button.
-
Select the test and action and click OK.
Set action properties
To set an action call's properties, you must set the values for each of the steps contained in the action separately.
-
Select an activity within the action whose properties you want to set.
-
In the Properties tab, provide values or data drive the properties.
-
The property values that you set will be the default values used when you add a call.
Note: If you reload the service using the Refresh button, the new version may add or remove properties. Properties that remain unchanged, will retain the default values.
Enable an action's data for editing when called by another test
To view or override an external action's data, you must expose it in its original location. This only applies to Excel type data sources, and only available for tests—not business components.
-
Define data for the action that you will be calling. Assign the data manually or use data driving. For details, see Assign data to API test/component steps.
-
In the Data Pane, select the data source's node.
-
In the Properties pane, open the Data Source Properties tab and select the Allow other tools to override the data option. The Data pane creates a local copy of the data which can be edited.
Override data from an action called by another test
-
Make sure the action that you want to call has its data exposed.
-
Open the test in which you want to add the call to the action.
-
From the Toolbox pane, expand the Micro Focus Automated Testing Tools node and add a Call API Action or Test or a Call GUI Action or Test activity onto the canvas.
-
In the Input/Checkpoints tab in the Properties pane, click the Select Action or Test button.
-
In the Select Action or Test dialog box, navigate to the test and select the desired action. Click OK.
-
In the Data pane, select the data source node.
-
In the Properties pane, open the Data Source Properties tab and select the Use a local, editable copy option.
-
Edit the data tables in the Data pane.