Test configurations

You can define test configurations to determine which data sets to use when running your test.

Test configurations overview

When you create a test, a test configuration with the same name as the test is created automatically. You can view this test configuration and add additional ones in the Test Configurations tab of the Test Plan module. You can associate a test configuration with data in the Parameters tab of the Test Plan module.

Test configurations facilitate test reuse and improve requirement coverage.

Facilitate test reuse

Test configurations essentially unbind the data from the test, making the test generic and facilitating the test's reuse. Using test configurations, you can:

  • Share common data sources across different tests.

  • Test various use-cases, each time with a different set of data.

Example:

You may want to check the same test in a Windows environment and again in a UNIX environment. In this case, you can define one test with two test configurations. The parameter values for the Windows configuration would contain Windows-specific values (for example, backslashes in a path name) while the UNIX configuration would contain UNIX-specific values (for example, forward slashes in a path name).

Improve Requirement Coverage

Test configurations provide finer granularity for requirement coverage. Instead of covering each requirement only at the level of the test, you can link a requirement to a specific test configuration.

Example:

You can use a single test to cover multiple requirements by associating different test configurations in the same test with each requirement.

Back to top

Create test configurations

You create test configurations for a test. For each test configuration, you can specify a subset of data or a run-time environment for the test.

Prerequisite:

  • The test where you want to define configurations is created. For details, see Create tests.

  • Test parameters are created for the test. For details, see Test parameters.

  • If you use test configurations for finer granularity of test coverage, define requirements in the Requirements module. For details, see Create requirements.

To define test configurations:

  1. In the test plan tree, select a test.

  2. In the Test Configurations tab, click New Test Configuration , enter the test configuration details, and click OK.

    Field Description
    Name Give the test configuration a unique name.
    Set Default Values Set default values for fields
    Use Default Values Fills in certain fields with default values if default values are set.

Back to top

Test types and test configuration data association

Depending on the test type, you can associate static data, dynamic data, or both for your test configuration.

The following table lists the supported test configuration data association methods for each test type:

Test Type

Static Dynamic

BUSINESS-PROCESS

FLOW

LR-SCENARIO

MANUAL

PERFORMANCE-TEST

QAINSPECT_TEST*

QUICKTEST_TEST

SERVICE-TEST

SYSTEM-TEST*

VAPI-XP-TEST*

VuGenScript

* You can associate test configuration data for this test type within ALM. However, to execute this type of test using its associated configuration data, run the test in other tools, such as the OTA API.

Back to top

Associate static data with test configurations

Static data enables you to specify sets of parameter values for a test directly from within ALM. Use static data when the amount of data you intend to associate is small.

To associate static data:

  1. In the test plan tree, select a test.

  2. In the Test Configurations tab, select a static configuration, and click the Data tab.

    If the test type supports both static and dynamic data, select the Static option.

    UI Element (A-Z)

    Description

    Static

    Changes the test configuration so it accesses static data defined within ALM.

    Available for: Test types that support both static and dynamic data. For details, see Test types and test configuration data association.

    Dynamic

    Changes the test configuration so that it access an external Microsoft Excel data resource file.

    Available for: Test types that support both static and dynamic data. For details, see Test types and test configuration data association.

    Select Columns. Opens the Select Columns dialog box, enabling you to determine which fields are displayed and their order.

    Replaces actual values with default values for the currently selected parameters.

    Enables you to update the actual value of all or selected parameters across all test instances associated with the selected test configurations in the Test Lab module.

    Used

    Indicates whether the parameter is included in a design step.

    Parameter Name

    The name of the parameter.

    Default Value

    The default value of the parameter as defined in the test level.

    Actual Value

    The actual value that is used for the parameter during the test run.

    Source Test

    Test in which the parameter was created.

    Available for

    • MANUAL

    • QAINSPECT-TEST

    • SYSTEM-TEST

    • VAPI-XP-TEST

  3. (For Business Process Testing) Create iterations.

    Existing iterations and the test parameter default values are displayed in a grid. Add or remove iterations as necessary. For user interface details on iterations, see Iteration Pages.

  4. Modify parameter values.

    Existing iterations and the test parameter default values are displayed in a grid. Modify parameter values as necessary.

    To modify the value of a static parameter, select a parameter, click the Actual Value field, and enter the desired value of the parameter.

    Tip: Business Process Testing: Business Process Testing users can click the Test Combination Generator button and generate test configurations with unique combinations of data values. For task details, see How to Generate Combinations for Test Configurations. For user interface details, see the Test Combinations Generator.

Back to top

Associate dynamic data with test configurations

Dynamic data enables you to specify sets of parameter values for a test from an external Microsoft Excel file., uploading it as a test resource into ALM, and associating it with the test configuration. Use dynamic data to specify large amounts of data that are easier to maintain in an external file.

Test-level and configuration-level dynamic data resources

You can supply ALM with dynamic data resources at the following levels:

Level Description
Test level You can supply a Microsoft Excel file that contains all parameter values at the test level. The Microsoft Excel file is uploaded as a data table in the Test Resources module, and associated with the test configuration in the Parameters tab of the Test Plan module.
Configuration level You can supply an alternate Microsoft Excel file, overriding the default test-level data resources file that is associated with the 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 in the Test Configurations tab of the Test Plan module.

Prerequisite:

To work with dynamic data for UFT One automated tests, make sure that the UFT One Add-in for Business Process Testing is installed on the client computer. The UFT One Add-in for Business Process Testing available from the Application Lifecycle Management Add-ins page (Help > Add-ins).

To associate dynamic data:

  1. Create a data table in Microsoft Excel.

    This data table contains rows of values which become parameter values for each iteration of your test configuration.

    1. Create a spreadsheet:

      • In Microsoft Excel.

      • If working with business process tests, in UFT One, you can export configuration values to a Microsoft Excel file, and use this file for your data table. See the information about exporting test iteration values into an Excel document in the UFT One help.

    2. Put test-level parameters in the first sheet. The entire test runs once for each row listed in the first sheet.

      Example:  

    3. Business Process Testing users can use subsequent sheets in the Excel file to override the business component iterations defined in business process tests and flows, according to the following guidelines:

      • The next sheets (meaning, all sheets but the first) represent components and their parameters.

        Note: If a component does not contain parameters, the Excel does not contain a sheet for that component.

      • In each sheet, the column headings (first row) containing the parameter names must be in one of the following formats:

        • <COMPONENT NAME>.<COMPONENT PARAMETER NAME>

          This format is the general, default format.

        • <COMPONENT INSTANCE NAME>.<COMPONENT PARAMETER NAME>

          This format is useful for keeping sheet names short.

        • <COMPONENT PARAMETER NAME>

          This format is useful if the name of the sheet is the same as the name of the component, and you need to keep the sheet names short.

        Notes

        • If the same component has been added to the same test multiple times, the numerical instance of the component in the test is listed between the component name and the parameter name. The component instances are listed according to their order in the test script, not necessarily in the order of the original numerical instance of the component when inserted.

        • The sheet name cannot be more than 32 characters long and cannot contain special characters. (This is a Microsoft Excel limitation.)

          Tip: When specifying column headings, it is helpful to use one of the last two formats listed above for parameter names in order to avoid this limitation.

      • Specify values for each parameter under the parameter names, each on a different row. Each row represents an iteration. Add iterations as necessary.

      Example:  

      The first sheet, that corresponds to the OrderingBooks business process test. The test will run once, because it is designed to run only for one store, BooksOnline.

      The second sheet corresponds to the Login business component. This business component will iterate only once, because only one user is listed as logging in.

      The third sheet corresponds to the OrderBooks business component. This business component currently iterates only once, because only book is listed.

      If we want to iterate the component multiple times, we could modify the third sheet (that corresponds to the OrderBooks business component) so that it more rows are added. This business component will iterate for every book listed—in this case, six times.

    4. Save the file.

        Caution:
      • When editing the spreadsheet in Excel, if no values / iterations are specified for a particular parameter defined in the component, test, or flow, an exception will occur at run-time.

      • If a component, group, or flow has input parameters that reference the output parameters of a different business component or flow, differences between the number of iterations can result in an error. The parameter name in the Iterations dialog box is displayed in red, indicating an iteration range mismatch.

  2. Upload the Microsoft Excel data table as a test resource.

    1. Select the Test Resources module. Either create or select a test resource folder.

    2. Click New Resource to create a new test resource.

    3. Enter Data Table as the resource type and click OK.

    4. In the Resource Viewer tab, click the Upload File button. Navigate and select the Microsoft Excel file you created and click Open.

    5. Click OK when prompted that the upload completed successfully. The Resource Viewer lists the default Microsoft Excel sheets. The data is now available in ALM.

    You can double-click the spreadsheet to view the data you created.

    Note: The data in the Microsoft Excel file starts with row number 2. It is assumed that the first row in the Microsoft Excel file contains the names for the data columns, which are mapped to parameter names in ALM.

  3. Associate the test resource with a test and/or its configurations.

    To associate the test resource with a test

    You can associate the test resource with a test. All test configurations for the test run using the data in this test resource (unless overridden in Test Configurations > Data).

    To associate the test resource with an entire test: 

    1. In the Parameters tab for the test, click the down arrow next to the Data Resource field in the toolbar.

    2. Navigate to and select the data resource and click OK. The Microsoft Excel file is now the default external data file for the test.

      To preview the resource, click Resource Preview .

    To associate the test resource with a configuration

    You can associate the data table with a test configuration. Each test configurations in the test run using the data table specified for the individual configuration, overriding the data table specified in the Parameters tab.

    To associate the test resource with a configuration:

    1. Ope the configuration. In the Data tab, select Dynamic.
    2. Select Override test data resource, and in the Data Resource field, specify an alternate data resource.
  4. Map test parameters to resource parameters.

    The test parameter names in the Excel data table do not have to match the parameter names defined in the test. They can be mapped. The mapping of resource parameters to test parameters facilitates reuse of the same resource file by different tests.

    To map parameters, in the Parameters tab for the test, click Map Parameters .

    UI Element Description

    Business Process Testing: Automatically maps each non-mapped test parameter to a parameter (column heading with the same name) in the external data table resource.

    For automatic mapping, the column heading in the external data table resource must match the test parameter name.

    The mapping is not case-sensitive.

    The order of the parameters in the external data table resource does not have to match the order of the parameters in the test.

    Note: If a parameter has already been mapped, the automap operation does not reset the mapping.

    Test Parameter Name Name of the test parameter as defined in the test.
    Resource Parameter Name

    Name of the column heading as defined in the external data table resource.

    Note: For an API test, type the parameter name in this format: <sheet_name>.<column_name>.

    Tip: For business process tests, you can select the column headings from a drop-down list. To clear the resource parameter name, select the blank row in the drop-down list.

    Mapping Status

    Business Process Testing: Status indicating if the test parameter is mapped to a parameter (column) in the external data table resource.

    • Not Assigned. The test parameter is not associated with an external data table resource parameter.
    • Assigned. The test parameter is associated with an external data table resource parameter.
  5. (Optional) Filter the data by selecting iteration ranges.

    To filter the data so that the test runs only on a subset of the parameter values, either by row or by value, click Data Resource Settings.

    Note: You can also use Data Resource Settings to map parameters. Parameters mapping related UI elements are not listed in the following table. For descriptions of these UI elements, see Map test parameters to resource parameters. .

    UI Element Description

    Business Process Testing

    Filtered Resource Preview. Opens the Data Viewer for the test resource. This enables you to see the dynamic data in the external data resource that match filter criteria (meaning, the data that will be used when the test configuration runs).

    Filter. Name of the filter.

    Row Filter. All rows or selected rows.

    Show mapped columns only. If selected, only data that is mapped to test parameters are displayed.

    <headings>. Column headings for the grid that also display the parameter mappings.

    <grid>. Rows of data that match the filter criteria.

    Filter Condition

    Condition for filtering out rows of data in the data resource. The test will not run on the filtered out rows of data.

    Specify a filter according to the following guidelines:

    • Only strings can be specified.

    • Do not specify quotation marks or operators.

    • Only one value can be specified.

    • The filter is case-sensitive.
    All Rows To process all rows that meet the specified filter condition, if one exists, in the data resource file, select All Rows.
    Rows To indicate a subset of rows, select Rows and enter the row numbers, separated by commas. A range of rows can be specified with a hyphen (for example, 3-5 means rows 3, 4, and 5 are processed).

Back to top

See also: