Generators

Definition

Generators are algorithms or data sources used to assign variables with values.  Several generators are available:

  • Basic data:  These generators generate data based on the data type they represent.  Use parameters to control the value that is generated.
  • Profile-based:  These generators retrieve data from a selected profile.  Profiles contain tables for code sets and other structures specifying message format and content.  If you must ensure that test messages are built with valid (or constrained) data, this generator is critical.
  • Record-based:  Those generators retrieve data rows from different data sources. During test execution, all variables that use the same generator, use the same record.

 

Advanced Mode

Combining Generators

In Advanced Mode, you can generate data with complex data formats by combining generators for a single variable.  For instance, a patient ID with the format XXX9999M (3 random characters, a number between 0000 and 9999 plus a static character at the end) can be generated by combining Excel, numeric, and string generators.

To combine generators:

  1. Click the Advanced Mode link in the generator section.
  2. Click the Add link that appears.
  3. Configure the newly created generator.
  4. Redo steps #2 and #3 if needed.

Change the generator order by dragging and dropping them in the generator chain.

 

Generator Formatting

Use the Generator formatting field to add more formatting. You can create sophisticated values that mimic unstructured data using this functionality. Formatting can be quite powerful.

Generator Formatting Generated Value Description
Numeric 0-99 He is {0} years old He is 34 years old
He is 17 years old
He is 88 years old
{0} is replaced with the generated value
Numeric 0-99 {0} + {0} = 2*{0} 34 + 34 = 2*34
17 + 17 = 2*17
88 + 88 = 2*88
A generator can be used several times
Numeric 0-99 {0:D5} 00042
93277
03007
15432
Adding leading zeros so the values has 5 digits
String (length=1)
Numeric 0-99999
{0} – {1} P – 22
C – 42
I – 1
L – 82
Generators are combined and formatting is added
Excel (first name)
Excel (last name)
{1}^{0} Doe^John
Smith^Suzan
Generators are combined to create a field value having 2 components (subfields)