Tutorial: Use the Test Combinations Generator

Relevant for: GUI tests and business process tests

This topic provides a tutorial for using the Test Combinations generator.

Scenario description

In this scenario, we'll use the MyFlights sample app that comes installed with UFT. You must test how the app performs with different sets of data. shopping site. You must test how the app performs with different sets of data. However, you have up to 5 fields that users can change, and the number of possible combinations is huge. Manually creating these data combinations will take too much time.

Use the Test Combinations Generator to help you create this large set of data, making test coverage all the more manageable.

If you've performed our tutorial, you already have a GUI test with actions for each page in the app. In this scenario, we'll use the Book Flight page, which is the page where a user enters the flight details they want to search for.

Back to top

Create test parameters and generate values

First create the parameters in your test that you want to generate values for. Then, use the Test Combinations Generator to generate those values.

Do the following:

  1. Add the following parameters to your test in the Data pane, and then save your test.

    • fromCity
    • toCity
    • departureDate
    • Class
    • numberofTickets
  2. Click the Test Combinations Generator toolbar button to open the dialog.

  3. Select a parameter name from the Parameter dropdown, or select it in the grid on the right.

    For all but the departureDate parameter, do the following:

    1. Define the Generation type as Capture from UI.
    2. In the Object Name field, click to switch back to the MyFlight app, and select the list item in the app that corresponds to the selected parameter. Back in the Test Combinations Generator dialog, the values are listed under Captured list of values.
    3. Click Select All, and then Generate to generate values for the grid on the right.

    For the departureDate parameter, define the Generation type as Date instead. Then define a date range for the dates you want to test, as well as a date format and the number of entries you want to add.

    Click Generate to generate date values for the grid on the right.

  4. When you have all of your data ready, click CREATE CONFIGURATIONS at the bottom right of the Test Combinations Generator dialog to display a preview of the possible data combinations.
  5. Switch the combination algorithm from Pairwise to Linear or Triplewise to display other possible combinations.
  6. Click Generate at the bottom right to generate your data, and add the values to the spreadsheet in the Data pane.

Your data is ready to use in your MyFlights GUI test.

Back to top

See also: