Integrate with Digital Lab and Jenkins

Run your mobile tests and cloud browser tests directly from a Jenkins continuous integration server as part of your product build process.

Set up Jenkins and connect to Digital Lab

To run tests on mobile devices or cloud browsers from Jenkins, set up the Jenkins plugin and connect it to Digital Lab.

To set up a Jenkins connection to Digital Lab:

  1. Install Jenkins and the Application Automation Tools plugin. For details, see the Jenkins plugin page.
  2. On the Jenkins Server home page, click Manage Jenkins > Configure System.

  3. In the Digital Lab section, click Add Digital Lab server.

  4. Enter a meaningful name for the Digital Lab server that you will be using, and its URL.

  5. Repeat the last two steps for each of the Digital Lab servers that you will be accessing.

  6. If UFT One and Jenkins are hosted on separate machines, create an execution node for the functional test.

  7. Click Apply or Save to keep your changes.

Connect via SSL

To connect to Digital Lab using SSL, select Use SSL in the Job Configure page.

If you are using a CA certificate, you must first install the certificate on your Jenkins machine. For details, see Install your CA certificate on a Jenkins machine.

Upload mobile apps

For details about uploading apps to Digital Lab using Jenkins, see the Digital Lab Help.

Back to top

Define Digital Lab server credentials on the Jenkins server

Define credentials that Jenkins uses to connect to the Digital Lab server when running tests on mobile devices or cloud browsers.

Application Automation Tools plug-in version Credentials
Earlier than 7.4

Enter the username and password in each job that runs mobile tests.

7.4 and later

Define either a username and password or an Access Key in each job that runs mobile tests, depending on the Digital Lab server requirements.

Back to top

Run Mobile tests from Jenkins

Run your test on a mobile device using both Jenkins and Digital Lab.

To run mobile tests from Jenkins: 

  1. On the Jenkins Server home page, click New Item, or click an existing item.

    If you select to create a new item, enter the item name.

  2. Select Build a free style project and click OK.

  3. In the General tab, scroll down to the Build section.

  4. Expand the Add build step drop-down and select Execute OpenText tests from file system.

  5. Click Digital Lab options and enter the Digital Lab details, defining settings for your test.

    1. Select the Digital Lab server from the drop down list.

    2. If available, select the Use Device Lab option.

    3. Click the Wizard button.

    4. Provide the user credentials and connect to the Digital Lab server.

      The user credentials can either be a username and password or an Access Key. For details, see Define Digital Lab server credentials on the Jenkins server.

      Note: If workspaces are enabled, you must also include the nine-digit tenant ID with your user name in the format username#ID. For example, admin@default.com#999999999.

      For more details, see the Digital Lab Help.

    5. Log into Digital Lab.

    6. In the wizard, select a device, choose apps, and configure the settings for your test. Click SAVE AND CLOSE.

  6. In the Tests box, enter a test with its full absolute path, or a folder or MTB containing one or more tests.

    To specify multiple entries, click the down arrow on the right of the field and enter each test path on a separate line. Make sure that the paths are accessible from all machines in the local network.

    Tip: Alternatively, indicate a batch file that contains a list of tests, along with their parameters. For details, see Use a batch file to specify multiple tests.

  7. Optional settings:

    UFT One parallel running mode

    Select to run your test on multiple environments.

    Then, add fields for new tests and environments as needed. Use the Digital Lab Wizard to define environments for each test defined.

    Note: When parallel testing is configured, any environments you defined in the Digital Lab wizard (see above) are ignored during your test run.

    For more details, see Run tests on multiple environments in parallel.

    Timeout Indicate a timeout, in seconds, after which the job will fail.
    Run Mode

    Define a UFT One run mode for your tests:

    1. Select UFT One-specific settings.
    2. From the Run Mode dropdown list, select Fast or Debug.

    For more details, see Test Runs Pane (Options Dialog Box > GUI Testing Tab).

  8. Click Apply to save your changes and continue with more build steps. Click Save when you are finished adding build steps.
  9. Add a post-build action to define settings for the UFT One test results.

    In the Post-build Actions section:

    1. Click Add post-build action, and select Publish OpenText test result.
    2. Select the Always archive OpenText test reports option.
  10. Run or schedule the job as you would with any standard Jenkins job.

    When test is completed, continue with Review test run results.

Tip: To troubleshoot, check the log file on the Digital Lab server for connectivity issues or security issues.

Use a batch file to specify multiple tests

Configure the Jenkins job to trigger multiple tests by specifying the tests in a batch file, together with their parameters.

Specify multiple tests, or even the same test several times, each time with different parameters. When specifying the path to your tests, Jenkins environment variables are supported for path names.

Give your batch file an .mtbx extension, and use the following sample syntax:

<Mtbx>
 <Test name="test1" path="c:\tests\APITest1">
 <Parameter name="A" value="abc" type="string"/>
 ….
 </Test>
 <Test name="test2" path="${WORKSPACE}\test2">
  <Parameter name="p1" value="123" type="int"/>
  <Parameter name="p4" value="123.4" type="float"/>
  ….
 </Test>
</Mtbx>

Pass parameters from one test to another in a batch test run

Supported on Application Automation Tools plugin version 7.6 and later

You can pass an output parameter from one test as an input parameter in another test.

To pass parameters from one test to another:

  1. In UFT One, define the output parameters to use as inputs for subsequent tests in each test.

  2. In each <Parameter> element in the batch file, you can leave the value empty and include a source attribute specifying the name of the output parameter whose value should be used.

    Example:

    <Test name="test2" path="c:\tests\GUITest1">
    <Parameter name="inputParam1" value="" type="string" source="outParam1"/>
    …
    </Test>

Note:  

  • When specifying the first test in a batch test run, leave the source attribute empty.

  • If there are 3 tests (A, B, C) in a test batch, parameters cannot be passed directly from A to C.

Back to top

Run Jenkins jobs sequentially on different devices

Run multiple, sequential Jenkins jobs using different devices, on the same UFT One machine.

To run multiple Jenkins jobs sequentially:

  1. Set up multiple jobs using different devices.

  2. For the second job, browse to the Jenkins Configuration page and locate the Build Triggers section. (Manage Jenkins > Configure System)

  3. Select the Build after other projects are built option, and in the Projects to watch field, enter the first job name.

  4. Optionally, select Trigger only if build is stable.

  5. Click Apply to save your changes and continue with more build steps.

    Click Save when you are finished adding build steps.

Back to top

Run different Jenkins jobs with different devices in parallel

Run different Jenkins jobs with different devices in parallel on different agent machines.

To run multiple Jenkins jobs in parallel:

  1. Set up the agent machines, and ensure that UFT One is installed on each one.

    For details, see Using Jenkins agents in the Jenkins documentation.

  2. Select Manage Jenkins > Manage Nodes and click the Configure icon to open the Configure page node.

  3. Enter the labels in the Labels fields.

    Make sure that the agents have different labels. You can also use the values assigned to the agents from the previous steps.

  4. Open the Configure page for each job, and select Restrict where this project can be run.

  5. In the Label Expression, enter the labels that you defined earlier.

  6. Save your changes.

Back to top

Run web tests from Jenkins on cloud browsers

Supported on Application Automation Tools plugin version 24.1.0 and later

Run your web test on a cloud browser using both Jenkins and Digital Lab.

To run web tests from Jenkins on cloud browsers: 

  1. On the Jenkins Server home page, click New Item, or click an existing item.

    If you select to create a new item, enter the item name.

  2. Select Build a free style project and click OK.

  3. In the General tab, scroll down to the Build section.

  4. Expand the Add build step drop-down and select Execute OpenText tests from file system.

  5. Click Digital Laboptions and enter the Digital Lab details, defining settings for your test.

    Settings you define in task override the ones defined in the UFT One Record and Run settings. For anything you don't specify in Jenkins, the Record and Run settings are used.

    1. Select the Digital Lab server from the drop down list.

    2. Select the Use Cloud Browser Lab option.

    3. Enter the URL of the application you want to test.

    4. Click Browser settings. A dialog box opens, based on the cloud browsers available on Digital Lab, enabling you to describe the browser on which you want to run the test.

    5. Select an Operating System, Browser Type and Version, and a geographic Location from which to select a browser.

      You can select a specific version or one of the following:

      • latest: the most recent version supported by your Digital Lab server.

      • latest-1: the second most recent version supported by your Digital Lab server.

      • latest-2: the third most recent version supported by your Digital Lab server.

      For the list of supported versions, see the Digital Lab Support Matrix.

    6. Click SAVE. The browser details you specified are displayed in read-only fields in the Jenkins job.

  6. In the Tests box, enter a test with its full absolute path, or a folder or MTB containing one or more tests.

    To specify multiple entries, click the down arrow on the right of the field and enter each test path on a separate line. Make sure that the paths are accessible from all machines in the local network.

    Tip: Alternatively, indicate a batch file that contains a list of tests, along with their parameters. For details, see Use a batch file to specify multiple tests.

  7. Optional settings:

    Timeout Indicate a timeout, in seconds, after which the job will fail.
    Run Mode

    Define a UFT One run mode for your tests:

    1. Select UFT One-specific settings.
    2. From the Run Mode dropdown list, select Fast or Debug.

    For more details, see Test Runs Pane (Options Dialog Box > GUI Testing Tab).

  8. Click Apply to save your changes and continue with more build steps. Click Save when you are finished adding build steps.
  9. Add a post-build action to define settings for the UFT One test results.

    In the Post-build Actions section:

    1. Click Add post-build action, and select Publish OpenText test result.
    2. Select the Always archive OpenText test reports option.
  10. Run or schedule the job as you would with any standard Jenkins job.

    When test is completed, continue with Review test run results.

Tip: To troubleshoot, check the log file on the Digital Lab server for connectivity issues or security issues.

Back to top

See also: