String Generator

Applies to TestComplete 14.93, last modified on September 16, 2021

The String generator is used to generate strings with TestComplete. Using this generator type you can populate the desired Excel file or TestComplete Table variable with character strings 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 String 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 String generator, you can specify the following parameters:

Minimum characters

Specifies the shortest character string that can be generated. The default value of the parameter is 1.

Maximum characters

Specifies the longest character string that can be generated. The default value of the parameter is 8.

Duplicate each value … time(s)

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

You can also specify which characters should be used to generate character strings. For example, strings can be generated by using letters, digits, spaces and punctuation marks. If you want to use certain characters when generating character strings, select the appropriate check boxes. Otherwise, clear the check boxes. The following check boxes are available:

  • Letters - By default, this check box is selected.
  • Digits - By default, this check box is selected.
  • Spaces - By default, this check box is selected.
  • Punctuation marks - By default, this check box is selected.

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 Data Generator Wizard.

See Also

Data Generator Wizard
Data-Driven Testing
Preparing Data for Data-Driven Testing

Highlight search results