Example: Running existing HCL OneTest API 9.5 suites dependent on WebSphere MQ user libraries with one suite that contains a stub on HCL OneTest Server

This example includes two existing HCL OneTest™ API 9.5 test suites. Both suites are dependent on WebSphere® MQ user libraries, but only one suite contains a stub. You migrate that stub suite, address the dependency on WebSphere MQ user libraries, run the suites on HCL OneTest Server, and see the results.

For an example of running a new 10.0 API test suite without stubs or user libraries, see Example: Running a new HCL OneTest API 10.0 test suite without stubs, user libraries, or secrets on HCL OneTest Server.

Before you begin

You must have installed and configured HCL OneTest Server and HCL OneTest API 10.0. HCL OneTest API 10.0 must be configured to use Git source control management.

In HCL OneTest API 10.0, you must have a project that is checked into a Git repository and that includes a test suite that relies on a stub as part of the local scenario configuration.

If you are a new user, you must first sign up with HCL OneTest Server by completing a form that specifies user information such as an email, user name and password, then you can log in by using that information. For more information about login and new user sign up, see Administering security.

About this task

A suite that references a local stub must be changed to reference a remote stub so that the suite runs on HCL OneTest Server. Therefore, in HCL OneTest API 10.0, you change a local stub to a remote stub, test that the suite runs successfully, and push the change into a Git repository.

Then, in HCL OneTest Server, you create a project and configure it to access a Git repository that contains HCL OneTest API suites, add WebSphere MQ user libraries, run the suites, and see the results.

Procedure

  1. Publish the stub to HCL Quality Server. See Publishing stubs.

    Publish local stub

    The stub is published to HCL Quality Server as shown on the Environments dashboard.

    Published stub on Environments dashboard

  2. Edit the suite scenario by opening the Scenario Editor.

    Open the Stub Scenario Editor

  3. Change the stub reference from local to remote. See Scenario reference settings.

    Change local stub to remote stub in the Scenario Editor

    As HCL OneTest API is integrated with Git, the change is flagged in the Test Factory.

  4. Deliver the change to your Git repository.

    Deliver the change to Git

  5. Run the suite and check that the stub runs remotely on HCL Quality Server.

    Results of executing a stub

    Now you are ready to create a HCL OneTest Server project.

  6. Log in by entering HCL OneTest Server URL in a browser. For example, https://<fully-qualified-dns-name>:443. The Home page is displayed where you create your project.
  7. Create a public project, which is the default. Enter a name and description for the project.

    Creating the MQ demo project

  8. Add the Git repository that contains HCL OneTest API suites:
    1. From the Repositories tab, add the Git repository URI, which in this example uses SSH authentication.
    2. To provide credentials, click the Expand icon Expand Git credentials and enter the required SSH key. This example also uses a passphrase.

      Adding a repository

    Your existing repository is downloaded to HCL OneTest Server so that it can be accessed.

    The repository is cloned

    The suites use a WebSphere MQ transport and require WebSphere MQ library files (JAR files) to run on HCL OneTest Server. Before you run the suites, you must make WebSphere MQ library files (JAR files) available to HCL OneTest Server.

  9. Copy WebSphere MQ library files (JAR files) from the location that you configured in HCL OneTest API Library Manager to the host system where you installed HCL OneTest Server and make sure that location ends with UserLibs/WMQ. For example ./opt/<anywhere_on_host>/UserLibs/WMQ

    Adding a repository

  10. Run the following Docker command to map a volume containing WebSphere MQ library files between your local file system and the Docker containers where HCL OneTest Server runs.
    docker run --rm -v /opt/<anywhere_on_host>/UserLibs:/ulsrc -v userlibs:/uldest alpine:latest cp -r /ulsrc/. /uldest/UserLibs

    For more information about the transports and their library files that must be copied, see Running tests.

  11. Open the Execution page to see a list of test assets in the repository. This example includes two suites. If you had many test assets in the repository, you could use the search option to filter the list. Run the test suite by clicking the Run icon Execute icon.

    Executing the test suite

  12. On the Schedule page, you can choose to run the test suite now, which is the default or schedule it to run later. In this example, schedule it to run now and click Execute to start the run.

    Executing the test suite now

  13. Open the Progress page to see the status of the suite as it runs.

    Executing the test suite progress

    The suite run completes successfully and this confirms that WebSphere MQ user libraries were found by HCL OneTest Server.

    Executing the test suite completes

  14. Open the Results page to see the suite results.

    Viewing the test suite results

    You can see the results were successful.

  15. This example includes a results database that was configured for the server project. Click Functional Report to see the result details in HCL Quality Server.

    Viewing the test suite functional report

    Next, run the suite that references a remote stub.

  16. Open the Execution page again and run the stub suite. Execute icon

    Executing the stub suite

  17. On the Schedule page, choose to run the test suite now and click Execute to start the run.
  18. Watch the stub status in HCL Quality Server by using the Environments dashboard. The suite starts the stub on HCL Quality Server, runs the test and then stops the stub. The suite run completes successfully. The stub change that you made in the Scenario Editor from local to remote worked. You can view the results.

    Stub suite execution completes

  19. Open the Results page to see the suite results.

    Viewing the stub suite results

  20. This example includes a results database that was configured for HCL OneTest API project. Click Functional Report to see the result details in HCL Quality Server.

    Viewing the stub suite functional report

What to do next

You can run a new API 10.0 suite on HCL OneTest Server. For details, see Example: Running a new HCL OneTest API 10.0 test suite without stubs, user libraries, or secrets on HCL OneTest Server.

Feedback