Work with keyword GUI automation

This section describes how to automate a component by adding keyword GUI steps to the component.

Note:  

Overview

Keyword GUI automated components are reusable modules that perform a specific task when testing your application. The tasks are defined as keyword steps. These steps can be viewed and edited both in ALM and in UFT One.

Each step is made up of an item (an object in the application or an operation), and an operation. The available items and operations are defined by the automation engineer in the object repository and the function libraries. These objects and operations can be saved in ALM, making them available for insertion into steps by the subject matter expert.

Object

Tests perform operations on objects. Objects are contained in the shared object repository that is associated with the application area on which your business component is based.

Objects can be sibling and child objects of the previous step's object.

Note: If an object included in a step is later removed from the shared object repository by the automation engineer, the run of the automated component fails.

Operation

Operations, or keywords, are customized functions that may group together multiple steps, as well as programming logic that can perform a specific task in your application.

For example, you can use an operation to open an application at the start of a business component, or check the value of a specific property of an object in your application.

Business Process Testing provides a set of basic keywords for you to use. The automation engineer can add to or enhance the keywords in UFT One. These keywords are derived from built-in methods and properties, as well as user-defined functions associated with the application area. The automation engineer manages the keywords and selects which of them should be available in the Select an Item list when creating automated components.

Note: If an operation included in a step is later removed from the library by the automation engineer, the run of the automated component fails.

Operation values and arguments

An operation argument provides the specific information that an operation uses to accomplish a specific purpose.

A particular operation may have required arguments, optional arguments, or no arguments at all.

In the keyword view, Value cells are partitioned according to the number of possible arguments of the selected operation. Each partition contains different options, depending on the type of argument that can be entered in the partition.

Keyword view parameterization

You can define input parameters that pass values into your business component, and output parameters that pass values from your component to external sources or from one step to another step. You can also define local parameters for use within the component only. You can then use these parameters to parameterize input and output values in automated steps.

You can define the following parameters from within a keyword step:

  • Local parameter. A local parameter is defined for a specific business component. It is not accessible by other business components. You define local parameters in the Keyword View Pane using the Value Configuration Options Dialog Box for input parameters and the Output Options Dialog Box for output parameters. You cannot delete local parameters, but you can cancel their input or output.
  • Component parameter. A component parameter whose value is set can be returned to or retrieved from a location outside the component. The values of these parameters can be passed from one component in a business process test or flow to a later one during a test run. You define component parameters in the Parameters Page of the Business Components module. For task details on working with component parameters, see Work with parameters, iterations, and configurations.

After you define a parameter you can use it to parameterize a value. You can also change the parameterized value back to a constant value by entering it directly in the Value cell.

Output value

For steps that return an output value, you can define settings that determine where the output value is stored and how it is used during the component run session. When the output value step is reached, each value set for output is retrieved and stored in the specified location for use later in the run session.

Output values are stored only for the duration of the run session. When the run session is repeated, the output values are recaptured.

After the run session, you can view the values retrieved during the session as part of the session results. For details, see Run business process tests and flows.

You can select a number of properties to output for the same object and define the output settings for each property value. When the output value step is reached during the run session, UFT One retrieves all of the specified property values.

If, after you specify an output value, you choose not to save the output value, you can cancel it.

BPT Packaged Apps Kit users can also add output values to a component during the Learn process.

Comment

A comment is a free text entry that you can enter on a new line below the currently selected step.

Comments are not processed when business components run.

You can use comments for several purposes.

  • You may want to add comments to a business component to improve readability and make it easier to update. For example, you may want to add a comment before each section of a component's automated steps to specify what that section includes.
  • You may want to use comments to plan steps to be included in a business component before your application is ready to be tested. Then, when the application is ready, you can use your plan (comments) to verify that every item that needs to be tested is included in the steps.

After you insert a comment, you cannot change it to a step.

Checkpoint

When creating a component, automation engineers working in UFT One can add standard checkpoints. A checkpoint compares the current value of a specified property with the expected value for that property, and can help identify whether your application is functioning correctly.

When a component containing one or more checkpoints runs, UFT One compares the expected value of the checkpoint to the actual value. If the value does not match, the checkpoint fails. You can view the results of the checkpoint in the Run Results Viewer. For details, see Run business process tests and flows.

BPT Packaged Apps Kit users can also add object property checkpoints to a component during the Learn process.

Back to top

Add keyword GUI steps

Automate a component by adding keyword GUI steps to the component.

To add keyword GUI steps:

  1. Prerequisites:

    • Make sure a testing tool, such as UFT One, is installed.

      Tip: If a testing tool is not installed, the button in the Automation tab is disabled.

    • Install the UFT One Add-in for Business Process Testing on the client computer. The UFT One Add-in for Business Process Testing is available from the Application Lifecycle Management Add-ins page (Help > Add-ins).

    • To be able to debug or run automated keyword GUI components, or view test results, make sure that UFT One 12.00 or later is installed. 

  2. Create an application area.

    Automating components involves the creation of application areas, which provide access to the settings and resources required for a particular application.

    1. Make sure that your application is ready to be tested, and all of the required automation resources have been prepared.
    2. In UFT One, if not yet connected, connect to the ALM project (for which you want to create the application area).
    3. For details, see the UFT One help.

    4. Do one of the following:

      • Create a basic application area based on a default template in the ALM Test Resources module. The default application area template is stored in the System Application Areas subfolder and cannot be moved or modified. An automation engineer can then enhance the application area in UFT One.

        The default application area contains very limited operation options from which to choose when created automated steps.

      • Work with an automation engineer to create the application area in UFT One.
    5. In ALM, create and upload the application area resource in the Test Resources module. You can also create other resources with which the application area is associated, such as libraries, object repositories, and recovery scenarios in ALM (and associate them to the application area in UFT One). For details, see : Test Resources.
    6. In UFT One, define the settings and resource files that you want business components associated with the application area to use. By associating a component with an application area, the component is automatically linked to these settings and resource files.
    7. In UFT One, define dependencies between entities. For details, refer to the Unified Functional Testing User Guide.

    Tip: You can view the associations between the application area and the other resources in the Dependencies tab in the Test Resources module in ALM.

  3. Select a component.

    In the Business Components module window, select a component in the component tree.

  4. Add keyword GUI automation.

    In the Automation tab, click and select Keyword GUI.

    The Keyword View pane is displayed. For user interface details, see Keyword View Pane.

  5. Select the application area.

    Note:  

    A keyword GUI component must be associated with an application area to create steps for it, but you can also change the application area when required.

    Changing an application area may affect the automated component and prevent it from running correctly. For example, if a step uses an object that is not contained in the object repository of the new application area, the step fails.

    In the Keyword View pane, select an application area if the following message appears next to the toolbar buttons:

    Choose an application area by clicking the 'Select Application Area' button

    Select an application area by clicking . For user interface details on the Select Application Area dialog box, see Select Application Area Dialog Box.

    All application objects in the associated object repository, and any operations defined in associated function libraries, are now available when automating steps.

  6. Add content (steps).

    1. Create the steps required to test your application. Each step is an operation to be performed, and is defined as a row in the Keyword View pane.

    2. For each step you add or modify, specify the following:

      • The item, such as an object from the application area's shared object repository, on which the step is performed.
      • The operation (keywords specified in the application area) to be performed on the item.
      • Any required values.
      • Output values.
      • Documentation, such as comments.

      For details of these concepts, see Overview.

    3. Save the steps.

      Tip:  

      • Since changes you make in the Keyword View pane are not saved automatically, it is recommended that you save them periodically.

      • A component is not fully automated until all of its steps are automated. For example, if you specify an Operation item with an Operation value of ManualStep, the automation is not yet complete. When running the component, there is a pause for user input.

      • You can record steps in other applications, creating components at the same time. For details, see Record components into flows and business process tests.

      • You can scan objects into the local object repository directly from within ALM instead of only from within UFT One. For details, see Scan Kwd in Keyword View Pane.

    For user interface details on the Keyword View pane, see Keyword View Pane.

  7. Parameterize steps.

    To expand the scope of your tests, flows, and business components, use variable input and output parameter values in your automated components.

    To parameterize... Use the...
    Input values for a step using local or component parameters Value Configuration Options Dialog Box
    Output values for a step Output Value Properties Dialog Box
    Expected property values from the Checkpoint Properties dialog box or the Output Value Properties dialog box Output Value Properties Dialog Box
  8. (Optional) Enhance steps.

    You can enhance your automated components by adding the following enhancements to your steps.

    Enhancement Description
    Comments

    Comments provide additional information in the form of free-text. You can insert comments between, and as placeholders for, step operations.

    For user interface details, see Keyword View Pane.

    Checkpoints

    Checkpoints compare the current value of a specified property with the expected value for that property, and can help identify whether your application is functioning correctly.

    The checkpoint is visible and editable in the Checkpoint Properties dialog box in ALM, enabling you to view which properties are set to be checked during the run. For user interface details, see Checkpoint Properties Dialog Box.

    Output Values

    For steps that return a value, output values store settings that determine where the output value is stored and how it is used during the component run session. When the output value step is reached, each value set for output is retrieved and stored in the specified location for use later in the run session.

    For user interface details, see Output Value Properties Dialog Box.

  9. Results.

    • The automation of the component is complete.
    • The icon for the component changes from the manual icon to the automated icon. For icon details, see Business Process Testing Icons.
    • The automated component can be accessed from UFT One.
    • Tests and flows that contain fully automated components can run in an automatic runner without pausing for user input.

Back to top