UI Create Test Data Rule 2 with Conditions and Actions

In this lesson, you will learn how to create the second 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 2 within the Suite:

Test Data Rule 2

IF (Account.balance >= 25000 && Account.balance <= 49999)

THEN Account.rewardLevel == “Silver”

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 2 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 2.

Condition 1

Make certain rule2 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 – 25000
  • 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 – 49999
  • Condition – THEN

Click the Save button once finished.

Completed Conditions for Test Data Rule 2

Step 3: Add One or More Actions to the Rule

For Test Data Rule 2, 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 – Silver

Click the Save button once finished.

Completed Action Configuration

Test Data Rule 2 – Completed Configuration

Note: The next lesson will show how to set up Test Data Rule 3 for this example.

Links:

https://genrocket.freshdesk.com/a/solutions/articles/19000103023

https://genrocket.freshdesk.com/a/solutions/articles/19000102994

Related Assets

GenRocket - Test Data Management

Download Literature

View Literature
GenRocket - Test Data Management

How to add and manage Test Data Rules within a Suite

Test Data Rules contain one or more Conditions and Actions, which define business logic to be applied when generating test data.

Read More
GenRocket - Test Data Management

How can we help
you today?

Request a Demo

See how GenRocket can solve your toughest test data challenge with quality synthetic data by-design and on-demand