This topic explains how to configure and apply the Data Generator tool, which stores data, such as numbers, strings, and dates into data sources or test suite variables for use in other tools. This tool is available in SOAtest and Virtualize.

  1. Right-click on a test suite, action suite, or responder associated with the data you want to extract and choose Add New > Test..., Add Output..., or Add New > Action (depending on whether you are using SOAtest or Virtualize).
  2. For SOAtest, click Standard Test and choose All Tools > Data Generator Tool. For Virtualize, choose Data Generator Tool in the tools panel of the Add Output wizard. If you are viewing tools by category, the Data Generator tool will be in the Data Exchange folder.
  3. Click Finish. An empty tool opens in the editor.
  4. Enter a name for the specific data set and click Add to open the data generator wizard.
  5. Choose a data type to generate and click Finish.
  6. You can specify a name for the specific instance of the Data Generator settings in the Name field. By default, the name of the generator type is used.
  7. Click on the Data Source Column tab to specify how data should be stored in the data source Column section:

  8. Click on the Configuration tab to specify how the values should be generated. See the following sections for specifics about how each generator creates different types of data:

    The following options are common to all data generators:
  9. When you’re finished configuring the tool, you can click Add to add additional data generators for your test suite or select a tool and click Remove to delete it.
  10. Click the save button when you’ve finished setting up your data generator(s).

Number Generator 

The number generator enables you to randomly generate numbers between a minimum and maximum value, as well as set the number of decimal spaces. Negative numbers are supported.

Defaults

When the minimum, maximum, and decimal place values are set to Fixed and left blank, the following defaults are used:

Minimum0
Maximum2147483647
Decimal places0

Additional Behaviors

The tool first generates a number that within the range specified in the Minimum and Maximum fields. Next, the number is rounded based on the number of decimal places specified.

You should enter a value in the Decimal places field equal to or greater than the largest number of decimal places specified in either the Maximum or Minimum values, otherwise the tool may generate a number outside the specified range when the number is rounded.

In the following example, the tool may generate a number outside the specified range:

Date/Time Generator

  1. Configure the start date in the Start Date section. 

  2. Configure the output settings in the Output section.

    The output settings can be fixed, parameterized, or scripted.
  3. Configure the tool to generate a past or future date in the Offset settings.

    You can specify how far off the generated date and time should be from the start date and time. You can use negative numbers to use past dates.

String Generator

The following fields are used to configure how strings are generated.

Pattern

This field defines the structure of the string.

The following special characters are used to define the pattern:

#This character is replaced with a number 0-9 when the tool runs.
&This character is replaced with a character as defined in the character map.
\Escapes the # and & characters, as well as other \ characters, so that they can be included in the generated string.

You can click the Pattern characters link to see this information in your IDE.

Character Map

This field specifies how characters map to the pattern characters. The default value when set to fixed is all printable ASCII characters, 0x20 (space) through 0x7e (~).

Example Usage

Using a fixed pattern set to ###-##-### and the default (empty) character map in fixed mode, you can generate social security numbers to use in your tests.