Starting a stub
When you have stubs in the API test assets, you can start the stubs contained in the API test assets from the Execution page in HCL OneTest™ Server.
Before you begin
- Been assigned the Tester or Owner role to run the tests.
- Created stubs that use a transport for tests in HCL OneTest™ API and committed the test resources to the remote repository.
- Selected the branch of the Git repository to view test resources on the Execution page.
- Enabled service virtualization through Istio at the time of installation of the server software, if you want to run the Istio stubs. See Prerequisites for running Istio stubs that virtualize services in HCL OneTest Server.
- Completed the prerequisite tasks before you start HTTP stubs. See Prerequisites for running HTTP stubs.
About this task
- Stubs that utilize the WebSphere® MQ transport.
- Stubs that utilize the HTTP transport.
- Stubs that virtualize the Istio services.You can run stubs for the following types of requests received or sent by the Istio service mesh:
- Requests received by services in the Istio service mesh.
- Requests sent from namespaces in the Istio service mesh to external services that are not in the Istio service mesh.
Procedure
- Open the project that contains the API suite with the stubs and click Execution.
-
Select the branch of the repository that contains the stubs that you want to run.
All test assets in the selected branch are displayed on the Execution page.
-
Identify the stubs that you want to run from the assets listed.
Tip: You can identify the stubs by the Stub icon for the test asset under the Type column. Stubs are displayed with the extension .stb in their names under the Name column.You can also identify the stubs by completing any of the following steps:
- Search for the stubs by entering any text contained in the test asset name in the Search field box.
- Create a filter query by using the New filter option and complete the following steps:
- Enter the relevant parameters and apply the filter query.
- Save the filter query for retrieving it from the saved filters list.
For example, you can create a rule, which has the Type attribute equal to API Stub, to display the stubs in the assets in the selected branch.
- Retrieve a saved filter by using the Open filters icon by completing the following steps:
- Select the saved filter.
- Apply the filter.
Note: To open the filter query, you must have created and saved a filter query.
-
Click the Execute icon in the row of the identified stub.
The Execute test asset dialog box is displayed.
- Select the version of the stub in the test asset that you want to start.
-
Select the time to schedule the starting of the stub from the following options:
- Select Now to initiate the start immediately after you click Execute.Important: Do not click Execute until you have configured the other settings in the Execute test asset dialog box.
- Select Later and configure the date and time to schedule the starting of the stub.
Note: You can ignore the Label field for the stubs. - Select Now to initiate the start immediately after you click Execute.
-
Select the environment that was used to bind the physical and logical resource
in the API project, in the ENVIRONMENT tab.
Important:
- The results are not captured for the stubs started or run on HCL OneTest™ Server and the stubs are not displayed on the Results page.
- The configuration that you set for the test run in the Execute test asset dialog box is preserved when you start stubs again. Those changes are not visible when another user logs in to HCL OneTest™ Server.
For example, if you selected an environment, the same environment is selected when you start stubs again.
- Click Execute.
Results
You have started a stub from the Execution page on HCL OneTest™ Server.
What to do next
- You can stop the running stub at any point after you start the stub.
- You can view the progress of the stub.
- You can view the Execution log for the stub.
You can verify whether the stub is running correctly by running the test in the API test asset that utilizes the stub and checking the Execution log to see whether the test has passed on the stub.
When you are done testing the stub, you must stop the running stub, see Stopping a stub.