Testing with Jenkins

You can use the Jenkins plugin for HCL OneTest™ UI to run tests on a Jenkins server by using a Jenkins build step.

Introduction

To automate testing with Jenkins, you must configure two computers: A Jenkins master and a Jenkins slave. This master-slave configuration allows a single Jenkins installation on the master computer to host multiple slave environments for building and running tests. You must install the newest version of the Jenkins plugin for HCL OneTest UI on the master computer, and install HCL OneTest UI itself on the slave, where you create the tests. For detailed information about the Jenkins master-slave relationship, see the Distributed Builds section on the Jenkins site.

Note:
  • Version 2.0 of the Jenkins plugin is now available and can work with the current as well as the previous versions of HCL OneTest UI.
  • The Jenkins plugin works only with HCL OneTest UI Eclipse integration.

Before you begin

  • Install IBM® Installation Manager, which is required to install HCL OneTest UI.
  • Install HCL OneTest UI.
  • Verify that you have a Jenkins master computer where Jenkins and the Jenkins plugin for HCL OneTest UI are installed.
  • Verify that you have a Jenkins slave computer where HCL OneTest UI is installed.
  • Verify that you have a functional test residing within an Eclipse workspace where HCL OneTest UI is installed.

Installing the HCL OneTest UI Jenkins plugins on the Jenkins master computer

  1. Download the HCL OneTest UI Jenkins plugin from HCL License & Delivery Portal.
  2. From the Jenkins dashboard, install the Jenkins plugin for HCL OneTest UI.
  3. Configure Global Security to allow Random TCP Ports for Java™ Network Launch Protocol (JNLP) agents.

Job Configuration

  1. Create a Jenkins free-style software project. For details, see https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project.
  2. From the Jenkins dashboard, click Build > Add build step and click Run a HCL OneTest UI test.
  3. Provide details about the test run as described below.

    Restrict where this project can be run

    The following table explains each field.

    Field Description
    Name Required. The name of the HCL OneTest UI test.
    Project Directory Required. The fully qualified path to the HCL OneTest UI project directory. Use '\\' or '/' as the file separator.
    Script Name Required. The name of the script to be run.
    Log Format Optional. The format of the script run logs. The options are: xml, html, text, and TPTP.
    Iteration Count Optional. The number of datapool iterations to be run.
    User Arguments Optional. Additional playback arguments, if any.
  4. Click Save to save the build step configuration.
  5. To run multiple tests under the same job, click Add build step again and provide details for the next test.

Master/Slave Configuration

Master and slave configurations are supported by this plugin. See the Jenkins documentation on Distributed builds for more information.

While creating the job configuration, in addition to the steps above, provide the name of the slave node as the Label Expression in the Restrict where this project can be run field. This is the location where the products are installed and where tests can be run.

Running tests

After creating the Job (project), open the project and click Build Now. This action starts the test run on the slave computer.

Build result and logs

  1. After the build completes, click the build number and open the console for the project. Look for Test Result to check the test execution status.
    Note: If you added multiple build steps to run multiple tests, you will find more than one Test Result.
  2. For product logs, log in to the slave machine and look in the Jenkins slave workspace/temp directory.
Feedback