UI Create Test Data Rule 3 with Conditions and Actions
In this lesson, you will learn how to create the third Test Data Rule in the Test Data Rule Suite that was created in Lesson 2 of this module.
What is a Test Data Rule?
- A Test Data Rule (TDR or G-Rule) defines the conditions to be met for a specified Domain and Attribute and the actions to be performed when those conditions are met.
- Test Data Rules form a conditional if-then statement.
What is a Test Data Rule or G-Rule Condition?
-
A Condition represents the IF portion of a conditional statement for 1 Domain and 1 Attribute. Conditions can also be combined using an AND or OR. Here is an example of a Condition:
IF (Account.balance <= 5000)
=>
What is a Test Data Rule or G-Rule Action?
-
An Action represents the THEN portion of a conditional statement for 1 Domain and 1 Attribute. A rule can have one or multiple Actions. Here is an example of an Action:
THEN (Account.rewardLevel == Basic)
For this lesson, we will be showing how to set up the Test Data Rule 3 within the Suite:
Test Data Rule 3
IF (Account.balance >= 5000 && Account.balance <= 24999)
=>THEN (Account.rewardLevel == “Bronze”
Step 1: Add a Test Data Rule to the Suite
Select the Test Data Rule (or G-Rule) Suite within the G-Rules Management Dashboard.
Click on the Add G-Rule button.
Enter a Description for the Test Data Rule and click the Save button.
Test Data Rule 3 will appear as shown below. Now, we can add one or more Conditions to the Rule.
Step 2: Add One or More Conditions to the Rule
Next, we will need to add 2 conditions to Test Data Rule 3.
Condition 1
Make certain rule3 is selected (highlighted in blue) and then click on the Add Condition button.
Within the Add G-Rule Condition dialog window, we have configured the following:
- Domain – Account
- Attribute – balance
- Qualifier – >=
- Value – 5000
- Condition – AND
Click the Save button once finished.
Condition 2
Click on the Add Condition button.
Within the Add G-Rule Condition dialog window, we have configured the following:
- Domain – Account
- Attribute – balance
- Qualifier – <= =
- Value – 24999
- Condition – THEN
Click the Save button once finished.
Completed Conditions for Test Data Rule 3
Step 3: Add One or More Actions to the Rule
For Test Data Rule 3, we will be adding one action.
Click on the Add Action button.
Within the Add G-Rule Action dialog window, we have configured the following:
- Attribute – rewardLevel
- Value Type – Constant
- Value – Bronze
Click the Save button once finished.
Completed Action Configuration
Test Data Rule 3 – Completed Configuration
Note: The next lesson will show how to set up the Default Test Data Rule for this example.
Links:
https://genrocket.freshdesk.com/a/solutions/articles/19000103023
https://genrocket.freshdesk.com/a/solutions/articles/19000102994
Search GenRocket Knowledge Base
Related Assets
How to configure Test Data Rule Conditions and Actions
Once a Test Data Rule has been added to the suite, the next step will be to add one or more Conditions and Actions to form a conditional statement.
Read More