Relevant for: GUI tests and components,API testing, and business process tests
For each test saved in ALM, a test configuration can be applied for the test to enable you to run the test with variable data. This enables you to use the same data file or data files repeatedly to provide changing data for a particular test run. Furthermore, you maintain fewer sets of data, in a central location in your ALM project, which is accessible for all tests in the project.
When you save a test, a default configuration with the same name as the test is created simultaneously. A test configuration is specific setup of test data that represents a business process use-case. This enables you to run the test with a variety of different data sources without manually editing the test steps. Test configurations essentially unbind the data from the test, making the test generic and facilitating test reuse.
Share common data sources across different tests
When you create a test configuration, you associate a specific data resource with that test configuration. However, since the test configuration - but not the data resource - is saved with the test, you can associate a data resource with many tests. When UFT One runs the business process test using a test configuration, it calls the referenced data source.
Test various use-cases, each time with a different set of data
As part of creating a test configuration, you both associate a specific data source with the configuration and specify which parts of the data resource should be used in this test configuration. When you change the data resource with each test configuration, you are able to see how your application performs with different sets of data. Furthermore, if you do not change the data resource with each test configuration, but reference different parts of the data resource, you can also see how the application performs with differing data.
When running test configurations, there are different ways in which to associate data with the test configuration:
Static data association
Static data is created by entering the data directly into the test configuration itself. This is done in ALM in a grid in the Test Configurations tab (in the Test Plan module)for the selected test.
In UFT One, this data is displayed as read only in the Test Configurations tab in the Properties pane:
Static data association is recommended when you only need a small amount of data for the test run.
Dynamic data association
Dynamic data association is created with an external Microsoft Excel file. After you have an Excel file with your test data prepared, you create a test configuration, and UFT One prompts you for the associated data resource.
This approach is recommended if you have large amounts of data that is maintained in an external file.
To help parameterize your test configurations, add Microsoft Excel (.xls) files in stored the Test Resources module. Once the Excel file is in the Test Resources module, map its column names to the data table parameters (for GUI and API tests) or test parameters (for business process tests). By mapping the column names to data table parameters, you enable UFT One to identify and use the correct parameter value during a run session.
Depending on the location in ALM you want to use for the test configuration's data, mapping is performed differently:
|With the data resource in the test's Parameters tab in ALM...||... you do not need to map the data table parameters to column names. You can, however, modify the filter settings by applying text filters to any parameter, and/or selecting the rows on which the configuration can run.|
|If you use a different data resources or override the data with another resource...||... you need to map the data table parameters to the column names in the .xls or .xlsx file.|
Example: Suppose you define three configurations in a single test to test an application that provides different solutions for Gold Card, Silver card, and Bronze Card users.
You could use the same data resource for each configuration by filtering the rows or text of the data resource to match the relevant user type.
Similarly, if your data is stored in various .xls or .xlsx files, you might want to run the same test using a different data source each time. You would do this by associating a different data source with each configuration.