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
- Step 2 - Add Conditions and Actions to the Rule
- Step 3 - Repeat Steps 1 and 2 for Each Rule
- Step 4 - (Optional) Add a Default Rule
- Step 5 - (Optional) Add the Rule Suite to a G-Case
- Next Steps - Generate Test Data
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"
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
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:
- 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.
- 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.