Integer Generator

Applies to TestComplete 15.70, last modified on December 17, 2024

The Integer generator is used to generate integers with TestComplete. Using this generator type you can populate the desired Excel file or TestComplete Table variable with some integers and then use this data in your tests. For more information on preparing test data, see Preparing Data for Data-Driven Testing.

To open the generator

  1. Click on the Tools toolbar or select Test > Generate Data from the main menu to call the Data Generator wizard.

  2. In the wizard, select the data storage.

  3. On the Data Generation Options page of the wizard, for the needed value, select Integer in the Data Generator column.

  4. Click Edit in the Parameters column.

Opening the data generator

Click the image to enlarge it.

– or –

  1. When adding a data-driven loop to a keyword test, select a table variable to store loop values.

  2. On the Variable’s Default Value page of the wizard, click on the toolbar.

Opening the data generator

Click the image to enlarge it.

– or –

When editing a table variable, click on the Edit Table Variable wizard toolbar.

Opening the data generator

Click the image to enlarge it.

Parameters

For the Integer generator, you can specify the following parameters:

Generation mode

Contains a drop-down list that allows you to specify a generation mode. The available modes are:

  • Random - Select this mode to generate random integer values within the specified range.

  • Sequential - Default. Select this mode to generate a sequence of values that will start from the Minimum Value parameter. The sequence's increment value is specified by the Increment value parameter.

Minimum value

Specifies the lower bound of the integers to be generated. The default value of the parameter is 1.

Maximum value

Specifies the upper bound of the integers to be generated. The default value of the parameter is 2147483647.

Increment value

Specifies an increment value for the generated sequence. Note that if you want to generate a descending sequence, you should specify a negative value for this parameter. The default value of the parameter is 1.

Note: The Increment value parameter is available only if you select the Sequential item in the Generation mode drop-down list.

The value of the Maximum value parameter must be greater than or equal to the value of the Minimum value parameter. The range for all three parameters (Increment value, Maximum value and Minimum value) is specified by the integer data type: -2147483648 … 2147483647.

Duplicate each value … time(s)

Specifies how many times each generated value will be duplicated. The default value of the parameter is False.

After you specify the needed parameters, you can obtain the sample values that have been generated by the engine. The values are displayed in the Sample field.

Also, you can discard all the changes you made in the generator’s parameters and restore the parameters set by default. For this purpose, click Set Default Values below the Sample field.

If you are going to use the same settings in several variables or if you configure one generator in the same manner from time to time, it is much easier to save the selected generator with the specified parameter values as a user-defined generator. For this purpose, click the Save to User-Defined button below the Sample field.

For more information on generating test data, see Using Data Generators.

See Also

Generators
Real Generator
Using Data Generators
Generate Data Dialog

Highlight search results