Relevant for: GUI tests only
UFT enables you to run both GUI and API tests for in a single unified test run.
Call an API test or action from a GUI test action
Insert a call to an API test or action in any GUI test action. During the test run, UFT pauses the steps of the GUI test, runs the API test or action in its entirety, and then continues the GUI test run.
During the run session, the Output pane displays a real-time log of the steps that are being performed in the API test.
Licensing for calling API tests and actions
To call API tests and actions, you must be using a UFT One Help Center license.
If a Unified Functional Testing license type is not available, the run session behavior differs, depending on how you are running the test:
|When running from UFT||
The GUI test runs until the step calling the API test is reached, and then fails.
|When running from ALM||If the GUI test contains a call to an API test, UFT does not open and the test does not run.|
For a use case scenario describing this process, see Using API tests in a GUI test - Use-case scenario.
Insert a new call
|Modify an existing call||Right-click the step select Edit Call to API Test/Action.|
Note: Do not insert a call to an API test or action that contains a call to a GUI test, as this can cause unexpected behavior.
UFT inserts a step that calls the API test or action.
The call to the API test is displayed in the canvas as a call inside the relevant action of the GUI test.
For example, in the Editor:
RunAPITest "<API test name>"
In the canvas:
After you add a call to an API test or action, the input and output parameters are available for use in your GUI test.
If you want to use values for the API test input parameters during a GUI test run, specify the parameter value in the Call to API Test/Action Dialog Box.
When the API test is run during the GUI test, UFT uses the values you specified for the appropriate parameters in the API test.
If you want to use values for the API test output parameters, you must assign a variable name to the output parameter in the Call to API Test/Action Dialog Box, or assign the API test output value to a variable or a data table parameter in the GUI test.
This variable or data table parameter is then available to use in other steps of the GUI test.