Sometimes, you may need to have certain test data that will be entered in a specific window or control of your tested application. Usually, creation of such test data is very tiresome and requires a lot of time. To make it easier to create such test data, LoadComplete now includes a special data generator that assists you in generating random test data of certain types: integer numbers, names, dates and so on.
Below are some tips on creating typical test data via the data generator.
Generating Random Passwords
To generate passwords, select the String data generator from the Data Generator list in the Generate Values dialog. After that, set both the minimum and maximum character values to 8 (or to any other number, depending on how long you want your passwords to be). LoadComplete will generate random values that can be used as a password. For instance, it can generate the following string - KAb1f`Y}.
Generating Titles for User Names
Using LoadComplete’s data generator, you can generate titles for user names, like Dr., Mr., Mrs. and Ms. For this purpose, select the Value from a Set data generator from the Data Generator list in the Generate Values dialog. After that, add each title to the list of Custom Values. Finally, set Generation mode to Random so that each user could get a different title. You can do the same thing for name suffixes, like Sr., Jr., III, and so on.
Building Custom Sentences
Sometimes, there is a need to enter some text, for example, in the Comments section. Instead of typing "My Comment", you can have LoadComplete combine data types, like an IP address and City, to automatically generate statements like "127.1.1.1 is located in Boston.". For this purpose, use the Custom String data generator.
Generating Birth Dates
To generate birth dates, select the Date and Time data generator from the Data Generator list in the Generate Values dialog. After that, choose Custom from the Date/time format combo box and enter
MM/dd/yyyy in the Date/time format string edit box. Set Generation Mode to Random and then set the Minimum Value to a value like
Generating Integer Numbers of a Certain Length
To generate integer numbers of a certain length, select the String data generator from the Data Generator list in the Generate Values dialog. After that, set the minimum and maximum character values to 3, for example (or specify any other number). Uncheck all of the boxes, except for Digits.
Generating Address Information
Using LoadComplete’s data generator, you can generate city names, street addresses and so on. However, if you need to generate a compound address, such as Apt 23 B and Suite 122, you can do this via the Custom String data generator.
%SET(Apt,Suite,Site) %Str(1,3,D) %Str(1,2,L)
This specifies a set of data (Apt, Suite, Site) that will be randomly chosen from, a 1-3 digit string that will give a numeric to the apartment, suite or site that gets chosen, and a 1 or 2 letter suffix.
Creating User-Defined Generators
To create a user-defined generator, do the following:
Configure one of the standard generators as you wish. These settings will be used for the created user-defined generator.
Click Save to User-Defined under the Sample field.
Specify the desired name for the created generator in the subsequent dialog and click OK to close it.
LoadComplete will automatically add the specified generator to the Data Generator list. This generator will correspond to the standard generator with the settings specified before you clicked Save to User-Defined.
After you create a user-defined generator, you can use it as any other predefined generator and it will be available to any LoadComplete project that is opened on your machine.
For more information on user-defined generators, see Working With User-Defined Data Generators.
For more information on using LoadComplete’s data generator, see Using Data Generators.