Testing with DevOps Test Integrations and APIs
You can use HCL DevOps Test Integrations and APIs (Test Integrations and APIs) extension to run API tests from HCL DevOps Test UI (Test UI). You can either import the projects from Test Integrations and APIs or manage them from Test UI by establishing the connection between the products. You can also create a compound test to run the tests by using the Agents.
Before you begin
You must have completed the following tasks:
-
Installed Test Integrations and APIs Extension for Test Integrations and APIs.
-
Installed DevOps Test Performance Agent and DevOps Test Integrations and APIs Agent to run tests remotely. When you install DevOps Test Integrations and APIs, you must have selected the This Agent will only run probes option.
-
Defined the environment variable INTEGRATION_TESTER_AGENT_HOME on each location where the Agent is installed, and have pointed to the root installation directory of Test Integrations and APIs Agent.
Note: The environment variables INTEGRATION_TESTER_HOME and INTEGRATION_TESTER_AGENT_HOME are automatically created when you install Test Integrations and APIs.
Setting environment variable
You must set the environment variable INTEGRATION_TESTER_AGENT_HOME and point it to the Test Integrations and APIs Agent installation directory if you are using Test Integrations and APIs Agent 10.2.1 or earlier.
-
Run the following command to set the environment variable on Windows:
INTEGRATION_TESTER_AGENT_HOME = C:\Program Files\HCL\HCLProducts\Agent
-
Run the following commands to set the environment variable on Linux:
INTEGRATION_TESTER_AGENT_HOME=/opt/HCL/DTIA-Agent export INTEGRATION_TESTER_AGENT_HOME echo $INTEGRATION_TESTER_AGENT_HOME
If the environment variable is not set, the compound or schedule test run fails with the following error message displayed in Execution Event Console:
Environment variable INTEGRATION_TESTER_AGENT_HOME not set to DevOps Test Integrations and APIs Installation location, or does not contain expected RunTest(.exe) program.Connecting to an existing API project
- In Test UI, right-click on the Test Navigator, select and click Next.
- In the wizard page, click Browse and select the root folder that
contains the project.
If the path contains a project, its name should automatically appear in Project Name and the Finish button should be enabled.
Setting Test Integrations and APIs preferences
- In Test UI, click .
- Click Browse and set the installation path to Test Integrations and APIs execution file. On Windows, the default location can be C:\Program Files\HCL\DevOpsTestAPI\IntegrationTester.exe.
- Click Apply and OK.
Opening Test Integrations and APIs resources from the Test Navigator
- Once the preferences are set, you can open an DevOps Test Integrations and APIs project.
- In the Test Navigator, open the project root node and children
nodes, and at any level, right-click and select Open in DevOps Test Integrations and APIs.
If Test Integrations and APIs is automatically detected, the workspace opens for the selected resources.
If Test Integrations and APIs is not detected, a dialog opens on a Preference page where you need to verify the path to the execution file.
-
Warning: Test Integrations and APIs cannot open more than one project at a time. If you have another project open, an error is displayed. In that case, close Test Integrations and APIs and try to open the project again.
Importing Test Integrations and APIs project
If both the products are not installed on the same machine, you can import an Test Integrations and APIs project in your workspace. Another reason for the import is when you have Test Integrations and APIs installed but you do not want to connect to the Test Integrations and APIs project. In that case, the project is duplicated, any updates in one product workspace is not reflected in the workspace of the other product.
- To import an Test Integrations and APIs project:
- Right-click on the Test Navigator, choose Import and select Existing project into workspace.
- Choose Select root directory or Select archive
file; select a project to import and click Finish.
The selected project appears in the Test Navigator and the compound test editor automatically opens.
Modifying Test Integrations and APIs environments in UI Test perspective
In the compound test, you can select Test Integrations and APIs tests and change the environment of each test. The environments are set in Test Integrations and APIs, you can only change the selection from the edited compound test.
- Open the compound editor and select a test.
- In the Test Integrations and APIs details, you can browse and change the properties of the selected test. The Test path, the Environments and Description are automatically updated accordingly.
- To select another environment for the Integration Tester test, use the dropdown menu.
Alternatively, you can change the environment selection for a test for a collection of tests:
- Right-click on the tree at any level under a node in the compound test and select Replace DevOps Test Integrations and APIs Environments.
- In the Set Invocation Tester Environments wizard, the first page displays the list of projects that use the selected environment and the number of tests from project that use this environment in the compound test.
- Select another used environment in the drop-down list.
- Click Finish.
The new choice applies to the selected node and its children.
Next step is to create a compound test in Test UI to run the test. See Running DevOps Test Integrations and APIs tests.
To map the tags in Test Integrations and APIs with variables in Test UI, you must follow these steps:
- Click the Test Integrations and APIs test that
contains the tags that you want to map.
The Test Integrations and APIs tags are displayed in the Integration Test Details pane.
- Click the tag that you want to map with the variable in Test UI.
- Click the Ellipses button inline with the tag that you want to map with a
variable.
The Variable Selection dialog is displayed.
- Select the variable, and then click OK.
The tag is mapped to the selected variable and it is displayed in the Variable column.
You can add a dataset mapper in the compound test for tests that are using multiple tags. See Adding Dataset Mapper to map tags in the Test Integrations and APIs tests with the variable values of Test UI.