Configuring the Freestyle project

You must configure a Freestyle project to add a build step, and then run tests that are available in your Rational® Test Automation Server project from Jenkins.

Before you begin

You must have completed the following tasks:

Procedure

  1. Open your Jenkins Freestyle project from the list, and then click Configure.
  2. Click the Build tab, and then click Add build step.
  3. Select the Run IBM Rational Test Automation Server test option from the drop-down list.
  4. Provide the details about the test run for the fields in the following table:

    The following table lists the required fields that you must provide to run the test from Jenkins:

    Fields Action
    Name

    Enter a name for the Jenkins build step.

    Server URL

    Enter the URL of Rational® Test Automation Server.

    The format of the URL is as follows: https://hostname.

    Offline Token Enter the offline user token that you generated from Rational® Test Automation Server.

    The following table lists the optional fields that you can provide to run the test from Jenkins:

    Fields Descriptions
    Asset Type

    Use this field to select the test asset type that you want to run from the Asset Type drop-down list.

    Branch

    Use this field to select the branch of the Git repository from the drop-down list.

    The Branch drop-down list displays the branches that are available in the corresponding project of Rational® Test Automation Server.

    Note: After you select the branch from the Branch drop-down list, if you want to change the URL of Rational® Test Automation Server, offline user token, or the project in the Build step, then you must close the build step. Then you must click Add build step, select Run Rational Test Automation Server test, and then enter the details.
    Datasets

    Use this field to enter the path to the dataset if you want to replace the values of the dataset during a test run.

    You must ensure that both original and new datasets are in the same workspace and have the same column names. When you enter a value for the Datasets field, you must also include the path to the dataset. The path must be in the following format:

    /project_name/ds_path/original_ds.csv:/project_name/ds_path/new_ds.csv

    Note: You can override multiple datasets that are saved in a different project by adding multiple paths to the dataset separated by a semicolon.
    Labels

    Use this field to add labels to test results when the test run is complete.

    You can add multiple labels to a test result separated by a comma.

    For example, label1, label2

    After the test run is complete, then the values provided in the Labels field are displayed on the Results page of Rational® Test Automation Server.

    Project

    Use this field to select a project from the drop-down list.

    The Project drop-down list displays the projects that are available in the corresponding team space of Rational® Test Automation Server.

    Note: The Project drop-down list displays the projects where you are an Owner or a member of Rational® Test Automation Server. You must be an Owner or a Tester of the project that is available in the team spaces to run the tests from the Jenkins server.
    Secrets Collection

    Use this field to select the Secret from the Secrets Collection drop-down list if you created secrets collections for your project to use Secrets at test run time.

    The Secrets collection field is mandatory only if you select one of the following options in the Asset Type field:
    • APISUITE
    • APITEST
    • APISTUB

    The following message is displayed when you select any other asset type than preceding list:

    You can select Secrets collection only if you are running tests of type APISUITE, APITEST, or APISTUB.

    Start Date

    Use this field to enter the date and time in the following format for running tests at the scheduled date and time:

    yyyy/MM/dd/HH:mm

    When you enter a value in the Start Date field, the status of the test displays as Scheduled on the Overview and Progress pages of Rational® Test Automation Server.

    Team Space

    Use this field to select the name of the team space from the drop-down list.

    The Team Space drop-down list displays the names of the team spaces if you are an Owner or a member of the team space.

    Test

    Use this field to select the required test that you want to run from the drop-down list.

    The Tests drop-down list displays the available test assets from the corresponding branch in the following format:

    Project_name [Path: the path of the test assets] [Repo: URL of the Git repository that the test belongs to]

    Note: After you select the test details from the Tests drop-down list if you want to change the URL of Rational® Test Automation Server, offline user token, or the project in the Jenkins Build step, then you must delete the build step and add a new build step.
    Test Environment

    Use this field to select an environment from the drop-down list.

    The Test Environment field displays the available test environments from Rational® Test Automation Server.

    The Test Environment field is mandatory only if you select one of the following options in the Asset Type field:
    • APISUITE
    • APITEST
    • APISTUB

    The following message is displayed when you select any other asset type than preceding list:

    You can select Test Environment only if you are running tests of type APISUITE, APITEST, or APISTUB.

    Use Custom Trust Store

    Select this checkbox if you used an internal CA certificate and imported the certificate to the custom trust store. You can then enter the file path of your trust store followed by the file name in the Custom Trust Store Path field.

    Select the Use Custom Password for the Trust Store checkbox if you modified the trust store password, and then enter the new password in the Custom Trust Store Password field.
    Note: If you did not modify the trust store password, you must clear the Use Custom Password for the Trust Store checkbox.
    Variables

    Use this field to enter the name of the variable and its value if your test requires variables during the test run time.

    You must enter the variables in the following format:

    name_of_the_variable=value_of_the_varibale

    You can add multiple variables to the test run separated by a semicolon.

    For example, varname1=value1;varname2=value2

    Note: You can run multiple tests sequentially in the same job by adding multiple build steps and providing details for the tests that you want to run.
  5. Click Save to save the build step.

Results

You have configured the Freestyle project by adding the build step.

What to do next

You can run test assets from the Jenkins server. See Running tests from Jenkins.