Story
Testers need to generate a 10-digit random, unique code consisting of 4 numbers, 2 characters, and then 4 numbers that will need to be used across several test data projects.
To save time and make this process easier, an Organization Attribute Suite can be created with this Attribute and its Generator configuration. Once created, the Attribute can be referenced by any Project within the Organization.
In This Article
- Step 1 - Create an Organization Attribute Suite
- Step 2 - Add Organization Attributes to the Suite
- Step 3 - Add and Configure Generators for Each Organization Attribute
- Step 4 - Reference Organization Attributes
- Step 5 - Generating Your Test Data
- Sample Output
Step 1 - Create an Organization Attribute Suite
An Organization Attribute Suite contains one or multiple Organization Attributes. Each Attribute will have its own Generator(s) and Parameter configurations.
- Click the Add Organization Attribute Suite button to create a new suite.
- Enter a Name and Description. Then click Save.
Step 2 - Add Organization Attributes to the Suite
Next, the tester adds a code Organization Attribute in this example. Complete the steps below:
- Click the Add Organization Attribute button.
- Enter a Name and an optional Description.
- Click Save once finished.
Step 3 - Add and Configure Generators for Each Organization Attribute
Users must add at least one Generator to each Organization Attribute. They can add a single Generator or use Linked Generators. To view step-by-step instructions, click here.
For this example, five Generators have been assigned to the code Organization Attribute.
- gen1 - Generates first 4 random numbers
- gen2 - Generates first random character
- gen3 - Generates second random character
- gen4 - Generates second 4 random numbers
- gen5 - Combines the values generated from the first 4 Generators into a single code.
Click on a Generator to select it. The selected Generator will be highlighted in blue and its Parameters will appear to the right. The steps for making changes to Generator Parameters and saving these changes are the same as when working with Domain Attributes.
Step 4 - Reference Organization Attributes
Once your Organization Attributes have been created and configured with the appropriate Generators, they can be referenced by individual testers across Projects. For step-by-step instructions regarding how to reference Organization Attributes, click here.
Organization Attributes can be referenced directly through Attribute Generators. Double click when viewing the Parameter Configuration for an Attribute Generator. For this example, the ConstantGen Generator will be shown:
In the Select Attribute to Reference dialog window, select the Organization Attribute tab.
Select an Organization Attribute Suite and then use the Plus (+) icon to reference the Organization Attribute within the selected Generator and Parameter.
Step 5 - Generating Your Test Data
Once the Organization Attribute has been referenced by an Attribute Generator within a Domain, Scenario Domain, or Test Data Case Domain, it will be included in the generated test data. This occurs when a Scenario, Scenario Chain, or Scenario Chain Set is ran from the Command or Terminal window.
For example, let's say the code Attribute is referenced within a User Domain of a Project as an Attribute titled "identificationCode". This code consists of a unique combination of letters and numbers. It will be generated for each user record generated by the User Domain.
To generate the data, we will need to download the User Scenario and then run it in the Command or Terminal window using the code line below:
genrocket -r UserScenario.grs
Sample Output
The output for this example would appear as shown below: