Generate test configurations for business process tests

This section describes how Business Process Testing users can use the Test Combinations Generator to generate test configurations to create a larger variety of test configuration data sets for test runs.

Business process test configurations overview

To expand the flexibility and reusability of business components, flows, and business process tests, you can create test configurations that represent different use-case scenarios, and have each configuration access different sets of data.

In addition to basic test configuration functionality available in ALM, a business process test configuration can be associated with multiple iterations, based on the number of sets of data supplied for that test configuration.

Test configurations associated with static data

Static data are sets of values provided for each parameter directly from within ALM.

When creating test configurations for manual and automated business process tests, you can create a set of static data for each use-case. For each test configuration, you can also add iterations and define different parameter values for each iteration.

For task details on creating test configurations that access static data, see Associate static data with test configurations.

Test configurations associated with dynamic data

Dynamic data are sets of values that are provided for each iteration’s parameters from outside of ALM, in an external data table (a Microsoft Excel file) uploaded in the Test Resources module.

When the business process test instance runs using a configuration that accesses dynamic data, the test instance fetches the parameter values for each iteration of the configuration from the list of parameter values in the Microsoft Excel file.

To work with external data tables for test configurations, install the Unified Functional Testing Add-in for Business Process Testing on the client computer. For details, see Tools, add-ins and extensions.

You can supply ALM with dynamic data resources:

  • At the test level. You can supply a Microsoft Excel file that contains all parameter values for each iteration of the configuration is specified at the test level. The Microsoft Excel file is uploaded as a data table in the Test Resources module, and associated with the business process test configuration in the Parameters tab of the Test Plan module.
  • At the configuration level (overriding any test-level data resources). You can supply an alternate Microsoft Excel file, overriding the test-level data resources file that is associated with the business process test as a whole. The Microsoft Excel file is uploaded as a data table in the Test Resources module, and associated with a specific configuration of the business process test in the Test Configurations tab of the Test Plan module.

For task details, see Associate dynamic data with test configurations.

Back to top

Configuration example with iterations

Consider the following business process test and its three configurations for a banking application comprising three business components: Login, ApproveLoan, and Logout:

  • The entire business process test tests the following aspects of the application:

    • Access rights are correct, based on the identity of the user.

    • Load is handled well, such as when a bank manager approves many loans using an external list of data created in Microsoft Excel.

    • A bank manager can approve urgent, high priority loans, based on a different external list created in Microsoft Excel. This external list is to be further narrowed down to include only those loans that have manager authorization.

  • To test access rights, a configuration named UserAccessData accesses static data, which provides different values for the test parameters Username and Password for three test iterations: One iteration provides the login information for an average loan processor, another for a bank manager, and the third for a system administrator for the application. Each of these users has different permissions and access to the application. The parameter values are specified within ALM.

  • A configuration named LoanData accesses dynamic data for one hundred different values for the LoanID input parameters used by the ApproveLoan component. These values are provided in a Microsoft Excel test resource of the data table type. A test iteration is run for each value in the Microsoft Excel file, so the test instance that uses this configuration runs one hundred times.

    Configurations can supply data values for test iterations and component iterations.

  • To test urgent loans, a configuration-level data resource can be defined to override the test-level data resource for the business process test. This data resource, UrgentLoanData, only contains high priority loans that are to be approved. One test iteration is run for each value that matches the filter criteria in the alternative configuration-level Microsoft Excel file (in this case, urgent loans that have been authorized for approval).

Back to top

Generate test configurations

Use the Test Combinations Generator when you have multiple parameters in your test, each with multiple possible values. The Test Combinations Generator enables you to select the combination algorithm you want to use and then automatically generates the possible combinations (without you having to do it manually).

To generate test configurations for your business process test:

  1. Prerequisites:

    Before using the Test Combinations Generator: 

    • The Unified Functional Testing Add-in for Business Process Testing must be installed.

    • The business process test cannot be read-only and must have parameters.

  2. Open the Test Combinations Generator.

    In the Test Plan module, select a business process test that has test parameters. In the Test Configurations tab, click Test Combinations Generator.

  3. Set the value of your parameters.

    Enter the possible values for your parameters as follows:

    • Manually. Click on a cell and enter the values for the parameters or cut and paste into the grid.

    • Import. Click Import to automatically import values for the parameters. Import an Excel file from the file system or an ALM project.

  4. Automatically generate values for parameters.

    For each parameter, perform the following:

    1. Click GENERATE PARAMETERS on the right of the Test Combinations Generator.

    2. In the Generate Parameters pane, from the Parameter drop-down list, select the parameter.

    3. In the Generation type, select the type for the parameter: 

      • Number

      • Date

      • Full name

      • First name

      • Surname

      • Password

      • City

      • E-mail

      • URL 

      • MAC address

      • IP address

      • Regular expression

      Tip: The Test Combinations Generator suggests the type of parameter to use if there is only one obvious match between the parameter and the value required.

    4. For each type of value, select the other options as needed.

      For example, for the First Name or Full Name value types, you can select English or Non-English types. For numbers, you can specify minimum and maximum values.

    5. Specify the number of entries (values) to generate.

      Tip: The Test Combinations Generator only generates unique items without duplication of values. For example, if you instruct ALM to generate 20 numbers, but limit the available values of the numbers between 95 and 100, only 6 entries are generated.

    6. At the lower right corner of the pane, click Generate.

      The values are added to the grid.

    7. Repeat for each parameter.

  5. Add a custom data generator.

    In addition to using UFT Developer's built-in dictionaries, you can create a custom data generator (xml file) for the parameter types in your test.

    When UFT Developer generates test combinations, it bases the combinations on all the xml files in the [<UFT Install directory]\dat\DataGenerators\ directory.

    1. Create an .xml file for your data generator in the [<UFT Install directory]\dat\DataGenerators\ directory.

    2. In the XML file, add the following XML:

      Copy code
      <Generators>
          <DataGenerator name="[CustomGeneratorName]" type="[GeneratorType]" title="[GeneratorTitle]" returnType="[GeneratorResultType]">
              ...
          </DataGenerator>
      </Generators>
      Element Description
      name A unique name for the generator type.
      type

      The generator type.

      • To specify the value format using a regular expression:

        MICRO_FOCUS.UFT.TCG.

        MICRO_FOCUS.UFT.TCG.DataGeneration.
        Generators.RegExpGenerator

      • To specify the values with standard strings, numbers, and so on: 

        DataGeneration.Generators.BaseRepositoryGenerator

      title The title of the generation type as it is displayed in the Test Configurations Generator.
      return type

      The format of the values to return.

      • String

      • Password

      • Number

      • Date

      Note: You can add multiple generator types in this XML file.

    3. In the Data Generator attribute, specify the parameter details using the Parameter element:

      Copy code
      <Generators>
          <DataGenerator name="[CustomGeneratorName]" type="[GeneratorType]" title="[GeneratorTitle]" returnType="[GeneratorResultType]">
              <Parameters>
                  <Parameter .... />
              </Parameters>
           </DataGenerator>
      </Generators>

      The attribute values for the Parameter element differ if you are using the regular expression type (MICRO_FOCUS.UFT.TCG.DataGeneration.Generators.RegExpGenerator) or the regular style (MICRO_FOCUS.UFT.TCG.DataGeneration.Generators.BaseRepositoryGenerator).

      Regular expression

      name: Must be the string pattern.

      defaultValue: The default regular expression pattern.

      type: Must be the string System.String.

      Non-regular expression
      • name: A unique name for the parameter.

      • defaultValue: The default parameter value.

      • type: Must be the string System.Boolean.

      • title: The parameter title.

    4. For non-regular expression-based parameter types, add the Repositories element:

      Copy code
      <Generators>
          <DataGenerator name="[CustomGeneratorName]" type="[GeneratorType]" title="[GeneratorTitle]" returnType="[GeneratorResultType]">
               <Parameters>
                     <Parameter .... /></Parameter>
               </Parameters>
               <Repositories>
                     <Repository.... />
                    </Repository>
               </Repositories>
          </DataGenerator>
      </Generators>

      The Repository element must contain the following attributes:

      Element Description
      name A unique name for the repository.
      path

      The path to the Excel file containing the possible values.

      useWhenCheck The name of the parameter entered in the Parameter element. This instructs UFT One to use the repository when a check box for one of the parameter values is checked.
      rule

      The format for data generation.

  6. Set values as Happy Path or Error Path.

    Select a value and click one of the following:

    • Happy path. The value is expected not to cause an exception or error.

    • Error path. The value is expected to cause an exception or error. This is useful for negative testing of your application.

    Business Process Testing changes the selected parameter to green (for Happy Path values) or red (for Error Path values):

  7. View the selected parameter combinations.

    After entering the possible values for all parameters, click View Combinations.

    • Regular path values. All possible combinations of the values are listed in the Permutations tab.

    • Error path values. All possible Error Path combinations are listed in the Error Paths tab, using the error path values.

  8. Change the testing combination algorithm.

    Different configurations can be generated depending on the selected combination algorithm (Linear, Pairwise, or Triplewise).

    Tip: Pairwise necessitates two parameters. Triplewise necessitates three parameters.

    In the Permutations tab, from the Algorithm drop-down list, select the appropriate algorithm for your testing needs. Business Process Testing updates the list of permutations accordingly.

    Note: Depending on the number of parameters, possible values, and combination algorithm, you may generate a large number of possible configurations. Business Process Testing can only display (and generate) up to 1000 possible configurations.

  9. Select the configurations to generate.

    If you define values as Happy Path or Error Path, you also have the option to generate all the different parts of the configuration.

    • In the Permutations tab, click the Filter button.

    • In the filter, select the combination types to generate.

    • If necessary, enter a name for the generated configuration.

  10. Generate the test configurations.

    At the bottom of the Test Combinations Generator, click Generate.

    Business Process Testing pauses for a few seconds or more (depending on the number of combinations), and creates the test configuration. Business Process Testing bases the combinations on all the xml files (both provided and custom xmls) in the [<UFT Install directory]\dat\DataGenerators\ directory.

    Configurations are added in the Test Configurations tab of the Properties pane.

    • If you did not define values as Happy Path or Error Path, one configuration is added.

    • If you defined values as Happy Path, a configuration is added with the suffix _happy.

    • If you defined values as Error Path, a configuration is added with the suffix _error.

    • A configuration is added for the remaining values with the suffix _default.

    The configurations are saved with the test and are available to use in test runs.

Back to top