Skip to content

User Guide

Daniel Gront edited this page Oct 8, 2018 · 2 revisions

Contents

Installation

Before you can run UFT tests as part of your build processes, you have to install the add-on on your Bamboo server machine. To install the add-on, do the following:

  1. Install UFT on the machine that hosts the Bamboo server.
  2. From the main Bamboo page (Build Dashboard), in the upper right corner of the window, click the Administration button and select Add-ons. The add-ons list is displayed in the Administration screen.
  3. Upload the add-on:
    1. In the Manage Add-ons section of the Administration window, click Upload add-on. A dialog opens enabling you to select the location of the .jar file for the add-on.
    2. In the Upload Add-on window, in the From my computer section, do one of the following:
      • Click the Browse button and navigate to the location of your .jar file.

      • Enter the URL of your .jar file.

        Note: This URL must be an absolute URL.

    3. Click Upload. Bamboo uploads and displays the installation progress in the Administration window. After the installation is finished, Bamboo displays a message describing the add-ons.
    4. Close the installation window, and you are ready to set up build tasks to run UFT tests. After you successfully install the add-on, UFT-related tasks are available in the Tests tab of the Tasks types window.
  4. Enable the Agent.
    1. From the main Bamboo page (Build Dashboard), in the upper right corner of the window, click the Administration button and select Agents. The Agents list is displayed.

    2. From the right column of the Agents list, click the Server capabilities link. The list of currently active server capabilities are displayed.

    3. From the right side of the server capabilities list, click the Detect server capabilities button. The server pauses for a moment and detects the ability to work with UFT. When the detection is finished, UFT should be displayed in the list of executables:

      Note: UFT is displayed in the list of executables only if UFT is installed on the server machine.

      If you plan on running a test on a remote host, you must restart the Bamboo remote agent on the remote computer after installing UFT to detect the new capabilities of the remote agent on the machine.

Run UFT tests in a Bamboo server build

Add UFT tests to a Bamboo server build process by adding them as build tasks from the build job. Before you start you must have a build project, plan, and job already created.

This topic includes:

Run local UFT tests

  1. In your build plan, add an additional task.

  2. From the Tasks pane, select the UFT File System Execution task. A new, empty task is added as part of your build plan.

  3. Provide the following information for your task:

    Task description (optional) A description to understand the purpose of the task.
    Tests The tests, test batch file, or folder containing tests to run. Each line in this field should contain the path to a test, test batch file(.MTB file name), or folder on the machine where the tests are to be run. You can enter multiple tests as needed.
    Timeout The amount of time (in seconds) to wait if there is a problem opening or running the test. If the field is left blank, there is no timeout.
    Archive and publish test results Instructs the server what to do with the test results after the test run is complete. Select one of the following:
    • Always archive test reports. Saves all test results, both for passed and failed tests.
    • Do not archive test reports: No test results are saved, regardless of the test status.
    • Archive test reports for failed tests: Only results for failed tests are saved.
  4. If you are running tests via Mobile Center (supported from Mobile Center versions 1.50), set up the integration as described in Set up server builds with Mobile Center.

    Note: If you need to use the Mobile Center wizard to select devices, apps, and test options, Mobile Center version 2.0 is required. For details, see Run the Mobile Center Wizard

  5. Save the configuration. When the build runs, the test will run as a build task with the specified settings. A new artifact is added in the Artifacts tab of the build project. After the test run, the relevant build logs are saved in the Logs tab of the build execution results. You can view details about the test run and links to test results.

  6. View the test results.

    After a test run, UFT automatically saves the run results to a selected location. Specify run results specific settings in the Run Sessions pane of the UFT Options dialog box (Tools > Options > General tab > Run Sessions node).

    To view the run results, do the following

    1. In the Artifacts tab, click the appropriate artifact link to download the report.
    2. Unzip and open the run results file, then do one of the following options:
      • Open the run_results.html file to view the run results.
      • In the Run Results Viewer select and open the Results.xml file. If you added multiple test tasks, the different tasks are differentiated by their 3-digit ID at the beginning of the task. You can see these when you view the artifacts in the Artifacts tab. For example:

Run UFT tests from ALM

  1. In your build plan, add an additional task.

  2. From the Tests pane, select the UFT ALM Execution task. A new, empty task is added as part of your build plan.

  3. Provide the following information for your task:

    Task description (optional) A description to understand the purpose of the task.
    ALM Server The ALM server from which to run the test. The ALM server address must be in the format: http://<ALM server name or IP>:<port>/qcbin
    User Name The ALM user name to use to access the server. Ensure that the ALM user specified in this task has the correct permissions to open and run the UFT tests. For details on permissions, see the Application Lifecycle Management Administrator Guide.
    Password The password for the ALM user specified above.
    Domain The domain in the ALM server where the project containing the tests is stored.
    Project The project containing the tests.
    Test sets The test sets to run with this build task. You should provide a full ALM path to these test sets. Each line in this field can contain a test name or folder.
    Timeout The amount of time (in seconds) to wait if there is a problem opening or running the test. If the field is left blank, there is no timeout.
    Advanced Settings You can specify the Run mode in one of the following locations:
    • Run locally: Runs the test on the same computer as the build
    • Run on planned host: Runs the test (as part of a scheduled test run) on a remote UFT computer
    • Run remotely: Runs the test on a remote UFT computer (not a scheduled run)
    If you select one of the remote computer options, specify the host on which you want to run the test. In order to run on the remote computer, you must set the Allow other products to run tests and components option in the Test Runs pane of the Options dialog box (Tools > Options > GUI Testing tab > Test Runs tab).
  4. Save the existing configuration.

    When the build runs, the test will run as a build task with the specified settings.

    After the test run, the build logs relevant to the test run task can be found in the Logs tab of the build execution results. You can view details about the test run and links to test results.

  5. View the test results. After a test run, UFT automatically saves the run results to your Bamboo server. In the Build Artifacts, you can view a html file with a link to the test run in your ALM project.

Run UFT tests from the ALM Test Lab

Note: If you want to set the environment configuration for the application being tested before this task, you can add an additional build task to your build plan. For details on how to do this, see "Configure the application environment". Configure the application environment

  1. In your build plan, add an additional task.

  2. From the Tests pane, select the UFT ALM Lab Management task. A new, empty task is added as part of your build plan.

  3. Provide the following information for your task:

    Task description (optional) A description to understand the purpose of the task.
    ALM Server The ALM server from which to run the test. The ALM server address must be in the format: http://<ALM server name or IP>:<port>/qcbin
    User Name The ALM user name to use to access the server. Ensure that the ALM user specified in this task has the correct permissions to open and run the UFT tests. For details on permissions, see the Application Lifecycle Management Administrator Guide.
    Password The password for the ALM user specified above.
    Domain The domain in the ALM server where the project containing the tests is stored.
    Project The project containing the tests.
    Run type Select one of the following types of runs:
    • Test set
    • Build verification suite
    For more details about test steps and build verification suites, see the Application Lifecycle Management User Guide.
    Test Set/Build Verification Suite ID The ALM ID of the selected test set or the build verification suite ID. If you select a test set, your test set should be a functional test set, and must be prepared for Server Side Execution. For details, see the Application Lifecycle Management User Guide.
    Description The description of the test set or build verification suite (as entered in ALM).
    Timeslot Duration The duration of the slot reserved for a scheduled run of the test set or build verification suite.
    Environment Configuration ID The ID of your application environment configuration, as entered in ALM. To find this ID, in ALM, right-click the entity, copy the URL, and paste it to a text editor. Use the number associated with the EntityID at the end of the URL.
  4. Save the existing configuration.

    When the build runs, the test will run as a build task with the specified settings.

    After the test run, the build logs relevant to the test run task can be found in the Logs tab of the build execution results. You can view details about the test run and links to test results.

Set up server builds with Mobile Center

You can integrate your server builds with Mobile Center. This integration lets you access devices and apps residing on the Mobile Center server.

Integration is supported for Mobile Center versions 1.50 and later. Integrations with the Mobile Center wizard, as described below, is supported for Mobile Center version 2.0 and later.

This topic includes:

Configure the Mobile Center server settings

  1. Create an UFT File System Execution task as described in Run UFT tests in a Bamboo server build.

  2. In the tasks configuration page, select Mobile Center Settings.

  3. Enter the following:

    Mobile Center URL The URL of your Mobile Center server.
    This information is also saved in the Mobile pane of the UFT Options dialog (Tools > Options > GUI Testing tab > Mobile node).
    Mobile Center User Name and Password The user name and password used to access Mobile Center.
    This information is also saved in the Mobile pane of the UFT Options dialog (Tools > Options > GUI Testing tab > Mobile node).
  4. If your connection to the Mobile Center server is secure, enable the Use SSL option.

  5. If your connection to the Mobile Center server is through a proxy, select Use Proxy and provide the proxy information.

Run the Mobile Center wizard

  1. Set up your Bamboo build for Mobile Center integration as described in Configure the Mobile Center server settings above.
  2. On the configuration page, click the Open Wizard button. The Mobile Center windows opens, as long as you have provided the correct server credentials in the previous step.
  3. When prompted, enter your credentials and click Login. The wizard opens to the Device tab.
  4. To select a specific device: If you want to run your test on a specific device, select Choose Specific Device in the left panel, to view the filter. For details about using the filters, see View and Manage Devices.
  5. To select a device by its capabilities: If you do not need to test a specific device, you create a rule that finds devices that meet your criteria. For example, if you need to test Android version 4.1 and higher, on any device, you create a rule that only requires 4.1 and higher. Mobile Center will only show the devices that match the criteria. In the left panel, select Choose Capabilities to access the Create Rule page. Choose the desired capabilities. You can use a wildcard (*) to specify an OS subversion, when using the "Equals" enumerator, for example, 4.*. Click the More information button in a device's row to access the auto-fill option, create a reservation, or see device information. For details, see View and Manage Devices.
  6. Click the Apps tab to view the available apps. Select one or more apps. If the app you want to test is not visible, make sure your filter is not hiding it. You can also add new apps with the Upload app button.

    Tip: It is best to upload at least one app manually, as described in Upload Mobile Center apps on the next page.

Upload Mobile Center apps

To select apps to run during your test, you can upload the app package files directly to the Mobile Center server, instead of using the wizard.

  1. Copy the app package files, for example, a file with an .apk extension, to the Bamboo server machine.
  2. Set up your Bamboo build for Mobile Center integration as described in Configure the Mobile Center server settings.
  3. On the Tests pane of the Tasks type page, click the Mobile Center Application Upload task.
  4. For each application, you want to add, specify the full path of the app package file on the Bamboo server.
  5. Save the configuration.

Configure the application environment

  1. In your build plan, add an additional task.

  2. From the Tests pane, select the UFT ALM Lab Management Environment Preparation task. A new, empty task is added as part of your build plan.

  3. If necessary, add a task description for the task.

  4. Enter the ALM login credentials for the ALM server, including:

    • ALM server
    • User name

    Note: Ensure that the ALM user specified in this task has the correct permissions to open and run the UFT tests. For details on permissions, see the Application Lifecycle Management Administrator Guide.

    • Password
    • Domain in which the project containing the tests is saved
    • Project in which the tests are saved

    Note: The selected project should be enabled for Server Side Execution of UFT tests. For details on Server Side Execution, see the Application Lifecycle Management User Guide.

  5. Enter the ID of the environment for which you want to create/update a configuration. To find this ID, in ALM, right-click the entity, copy the URL, and paste it to a text editor. Use the number associated with the EntityID at the end of the URL.

  6. Select one of the following options:

    • Create a new configuration named: Enter a name for the new configuration. If you select this option, enter a string variable in the Assign AUT Environment Configuration ID to: field. (Bamboo will save an ID for this variable for use in future tasks.)
    • Use an existing configuration with ID: Enter the ID of your AUT Environment Configuration in ALM.
  7. (Optional) Enter a path for a JSON file that contains values for the AUT Environment parameters for the relevant configuration.

  8. Add the AUT Environment parameters that you want to update for the configuration.

    1. Click the Add Parameters button.
    2. For each parameter, select the type of the parameter from the drop-down menu (Manual, Environment, or From JSON).
    3. Enter the full path of the parameter as it appears in ALM. For example, you could enter Parameters/my_param1.
    4. Enter the value you want to assign to this parameter.
  9. Save the existing configuration. This configuration will be applied as build step when building the entire build process.

Known issues

If you have trouble with the Micro Focus Bamboo plugin, see the following details for troubleshooting and limitations:

  • In the Security and Permission options for the server, you must clear the Enable XSRF protection option before running tests on your Bamboo server.
  • If you are using the ALM Lab Management Environment Preparation Configuration task, the ALM server should be accessible from the server machine.
  • When using the ALM Execution task:
    • If you receive an error the first time you run a test with this task, you need to install the TD connectivity tool. The link to install this tool can be found in the build log.
    • If the same error occurs on subsequent test runs, you must reregister the ALM client on the server machine.

For details on how to install the TD connectivity tool or register the ALM client, see your ALM documentation.

  • If you are running a test on a remote host, you must restart the Bamboo remote agent on the remote computer after installing UFT to detect new capabilities of the remote agent machine.
  • If your build failed to create the UFT File System Execution or MC Application Upload tasks, try to disable the XSRF protection in the following way:
    • Click the Administration button and select Overview.
    • Select Security Settings under the SECURITY section.
    • Click Edit and clear the Enable XSRF protection option.