Share this page

# How to Generate Combinations for Test Configurations

This task 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.

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).

For additional details on using the Test Combinations Generator from within UFT One, see the Micro Focus Unified Functional Testing User Guide.

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 must have parameters.

2. Open the Test Combinations Generator

   In Test Plan module, select a business process test.

   In the Test Configurations tab, click the Test Combinations Generator button .

   For user interface details, see 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.

      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:

          <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: MICROFOCUS.UFT.TCG. MICROFOCUS.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:

          <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 (MICROFOCUS.UFT.TCG.DataGeneration.Generators.RegExpGenerator) or the regular style (MICROFOCUS.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:

          <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 repostiory.
      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.

       Example:

       <DataGenerator name ="FullNameGenerator" type="MICROFOCUS.UFT.TCG.DataGeneration.Generators.BaseRepositoryGenerator" title="FullName" >

           <Parameters>

               <Parameter name ="english" defaultValue ="true" type ="System.Boolean" title= "English"/>

               <Parameter name ="non-english" defaultValue ="false" type ="System.Boolean" title = "Non-English"/>

           </Parameters>

           <Repositories>

               <Repository name ="fr_full_names" path ="FrenchFirstLastNames.xlsx" useWhenCheck ="non-english">

                   <Rule>[MaleName] [Surname]</Rule>

                   <Rule>[FemaleName] [Surname]</Rule>

              </Repository>

              <Repository name ="en_full_names" path ="EnglishFirstLastNames.xlsx" useWhenCheck ="english">

                   <Rule>[MaleName] [Surname]</Rule>

                   <Rule>[FemaleName] [Surname]</Rule>

             </Repository>

             <Repository name ="jp_full_names" path ="JapaneseFirstLastNames.xlsx"

                   useWhenCheck ="non-english">

                   <Rule>[MaleName][Surname]</Rule>

                   <Rule>[FemaleMaleName][Surname]</Rule>

                   <Rule>[FemaleName][Surname]</Rule>

             </Repository>

             <Repository name ="ru_full_names" path ="RussianFirstLastNames.xlsx" useWhenCheck ="non-english">

                   <Rule>[MaleName] [MaleSurname]</Rule>

                   <Rule>[MaleName] [FemaleMaleSurname]</Rule>

                   <Rule>[FemaleName] [FemaleSurname]</Rule>

                   <Rule>[FemaleName] [FemaleMaleSurname]</Rule>

             </Repository>

           </Repositories>

       </DataGenerator>

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.

https://admhelp.microfocus.com ALM 8942
Tips to improve your search results... ALM Help Center ALM Help Center ALM Help 16.00-16.0.1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: