Description

Test Data Rules contain one or more Conditions and Actions that define the business logic generated data should follow. Users can also add a default rule that determines the Action(s) taken when no conditions are met within the suite. 

 

In This Article


Step 1 - Add a Test Data Rule to a Suite

  • Select the Test Data Rule Suite and click on Add G-Rule.



  • Enter a Description and click Save.



Step 2 - Add Conditions and Actions to the Rule

Conditions and Actions form a conditional If-Then Statement. A rule can have one or more conditions and actions. For example, the following represents two conditions and one action that form a rule: 

IF (Customer.balance >= 5000 && Customer.balance <= 10000)
THEN Customer.rewardLevel == "Gold"

A Condition represents the If portion of the statement and defines what criteria must be met for a corresponding action to occur. A Condition can be:

  1. Value-Based - Based on a constant value (e.g., true, false, yes, no). 
  2. Variable-Based - References a variable (e.g. Domain Attribute).


An Action represents the Then portion of the statement and defines what will occur when the defined Conditions for the rule are met. An Action can be: 

  1. Value-Based - Assign a specific value to the selected Attribute 
  2. Generator-Based - Use a Generator to assign the value to the selected Attribute


An example is shown below for the rule discussed above. Click here to see step-by-step instructions for adding conditions and actions to a rule. 



Step 3 - Repeat Steps 1 and 2 for Each Rule

Add each rule to the suite. Then, set up each rule's condition(s) and action(s). The example below has two rules.
 


Step 4 - (Optional) Add a Default Rule

A Default Rule can be added to ensure an action is taken when defined conditions for all rules in the suite are not met. The following applies to Default Rules:

  • Only 1 Default Rule can be added to a suite.
  • A Default Rule can have several Actions. 
  • Each Action is defined for 1 Domain and 1 Attribute.


Complete the following steps to add a default rule: 

  • Click the Add Default Rule button.

     
  • Enter a Description and click Save.

     
  • Add one or more Actions (same steps as when adding to any rule).


Step 5 - (Optional) Add the Rule Suite to a G-Case

A rule suite can be added to a Test Data Case (G-Case) and applied during test data generation. When added, the generated test data for the case will adhere to the defined logic.


Next Steps - Generate Test Data

Once set up, the user is ready to generate their test data. To do so, they will need to do one of the following: 

  1. G-Rules Not Added to a Case - Download the Scenario, download the Rule Suite, download the required configuration files, and run the command at the command line. See How to generate test data with G-Rules and a Scenario for more information. 

  2. G-Rules Added to a Case - Download the Scenario, download the entire Case Suite or individual Cases, download the required configuration files, and run the command at the command line. See How to Download and Run Test Data Cases for more information. 


Note: The location of the downloaded files on the user's local machine depends on what paths have been configured for organization resources and in the Receiver parameters. You may receive a Runtime error if a file is not in the right location.