UI Create Test Data Rule 1 with Conditions and Actions

In this lesson, you will learn how to access the G-Rules Management Dashboard and create a Test Data Rule (or G-Rules) Suite.

What is a Test Data Rule Suite?

  • A set of Test Data Rules that can be used to apply business logic during test data generation.
  • Each Test Data Rule Suite has its own Test Data Rules with defined Conditions and Actions that form a conditional if-then statement.

What is a Test Data Case or G-Case 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 Case or G-Case 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)

Prerequisites

In this example, we have set up a Sample Project with three Domains: User, Account, and Address. The Test Data Rules that will be created for this example apply to the Account Domain.

Currently, the rewardLevel is assigned to each account randomly. Rules need to be created so that the balance determines what rewardLevel will be assigned to each Account. The test data will appear as shown below when no rules are applied:

For this lesson, we will be showing how to set up the Test Data Rule 1 within the Suite:

Test Data Rule 1

IF (Account.balance >= 50000 && Account.balance <= 99999)

THEN Account.rewardLevel == “Gold”

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.

The Test Data Rule 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 1.

Condition 1

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 – 50000
  • 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 – 99999
  • Condition – THEN

Click the Save button once finished.

Completed Conditions for Test Data Rule 1

Step 3: Add One or More Actions to the Rule

For Test Data Rule 1, 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 – Gold

Click the Save button once finished.

Completed Action Configuration

Test Data Rule 1 – Completed Configuration

Note: The next lesson will show how to set up Test Data Rule 2 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 a new Test Data Rule Suite to a Project Version

A Project Version within a Test Data Project may have one or multiple Test Data Rule Suites.

Read More
GenRocket - Test Data Management

How can we help
you today?