Once a Test Data Rule has been added to the group, the next step will be to add one or more Conditions and Actions to form a conditional statement for the Test Data Rule. 


Each Condition or Action is defined for a single Domain and Attribute. Test Data Rules may have multiple Conditions and Actions.


These items define the business logic to be applied when test data is generated for the selected Domain and Domain Attribute. 



The following topics are covered in this article: 

  • Condition Configuration Options
  • Adding Conditions to a Test Data Rule
  • Action Configuration Options
  • Adding Actions to a Test Data Rule
  • Editing Conditions and Actions for Test Data Rules
  • Deleting Conditions and Actions for Test Data Rules

Note: For more information about accessing and viewing Test Data Rule Groups, please see: How to Access and View Test Data Rules for a Project.


Condition Configuration Options


A Condition defines what criteria must be met for a corresponding action to take place. When a Condition is defined for a Test Data Rule, it determines what action will be taken based on the configuration options shown below:



Each option is described in further detail below:


OptionRequiredDescription
DomainYesThis is a Domain from the Project the Test Data Rule Group belongs to.
AttributeYesThis is an Attribute from the Domain selected for the Condition.
QualifierYesThe qualifier determines how certain or absolute the Condition is in relevance to the Value.

The following Qualifiers are available for a Condition.
  • Equal To ==
  • Greater Than >
  • Greater Than or Equal To >=
  • Less Than <
  • Less Than or Equal To <=
  • Not Equal To !=
ValueYesThis is the Value that corresponds with the Qualifier. (Example - if age <= 12)
Is StringNoThis box should be checked if the Condition is a String. It is unchecked by default. 
ConditionYes

Used to form conditional statements where one or more conditions must be met for the defined actions to take place. 

  • AND - The added condition must be met along with other defined conditions for the rule. 

  • OR - At least one of the defined conditions must be met. It can be the currently defined condition or another condition added to the rule. 

  • THEN - This option should be selected when defining the last condition for the rule. Selecting THEN shows that all conditions have been defined and an action will take place if one or more are met.
GroupNoEnter a name to set up brackets for the condition. Example: if (type=child && age<=10) or (type=child && age <=18), then action.

For example, the first set of brackets could be labeled as Group A and the second as Group B.

A Group Name is optional when setting up a Test Data Rule Condition.



Adding Conditions to a Test Data Rule


Complete the following steps to add a Condition to a Test Data Rule:

  • Click on Add Condition within the If Condition section of the Test Data Rule configuration.


  • Next, select the Domain the condition will apply to. For this example, the User Domain will be used.

  • Select the Attribute the condition will apply to. For this example, the Age Attribute will be used.


  • Select a Qualifier. For this example, < will be chosen.

  • Next, enter a Value that will be used to evaluate the condition to determine if it has been met or not.  For example, IF the User.age is < 18, then Action.

  • Check the Is String checkbox if it is a string. For this example, an Integer is used and this option should remain disabled.


  • Select a Condition for the Test Data Rule. For this example, THEN is chosen.

  • Enter a Group Name (Optional) for the condition if brackets are to be used.

  • Click Save to finish.


  • The new Condition will appear in the IF Conditions Table as shown below:


  • The Pseudo Code Panel will also show a preview of the Test Data Rule Condition.


    Note: The order of Conditions can be changed by performing a Click+Drag action. Drag a Condition up or down to change the order.


Action Configuration Options


An Action defines what will take place when one or more Conditions for the rule are met. When an Action is defined for a Test Data Rule, it determines what will happen with the generated test data for a selected Domain and Attribute based on the configuration options shown below:



Each option is described in further detail below:


OptionRequiredDescription
DomainYesThis is a Domain from the Project the Test Data Rule Group belongs to.
Attribute YesThis is an Attribute from the Domain selected for the Action.
ValueYesThis is the Value that will be assigned when a Condition is met.

For example, If User.age <18, Then User.allowedtoVote = false.
"false" is the assigned Value in this example.

Is StringNoThis box should be checked if the Action is a String. It is unchecked by default. 


Adding Actions to a Test Data Rule


To add an Action to a Test Data Rule, complete the following steps: 

  • Click on Add Action located within the Then Action section of the Test Data Rule configuration.


  • Next, select a Domain and Attribute for the Action.

  • In this example, the User Domain and allowedtoVote Attribute have been chosen.


  • Enter the Value that will be assigned to the selected Attribute when one or more Conditions are met.

  • In this example, the value will be false because the person is under age.


    Note: The Is String option may be checked when the Value is a string, but is not required. It is unchecked by default.


  • The new Action will appear as shown below:


  • It will appear similar to what is shown below in the Pseudo Code:


    Note: The order of Actions can be changed by performing a Click+Drag action. Drag an Action up or down to change the order.


Editing Conditions and Actions for Test Data Rules


A Condition or Action may be modified the same way. When editing the information for a Condition or an Action, you will be able to change any of the configuration options. 


Note: The images below will show how to edit an Action.


To edit a Condition or Action, complete the following steps: 

  • Click on the Edit (Pencil) Icon within the Action Column.


  • Make any needed changes by clicking on the input fields or selecting options from the drop-down menus.

  • In this example, the Value has been changed to true.

  • Click Save once finished to save your changes.


  • Changes will be displayed within the appropriate section (Conditions or Actions) of the Test Data Rule configuration.



Deleting Conditions and Actions for Test Data Rules


A Condition or Action may be deleted from a Test Data Rule in the same way. 


Note: The images below will show how to delete an Action.


To delete a Condition or Action from a selected Test Data Rule, complete the following steps: 

  • Click on the Delete (Trash Can) Icon within the Action Column.


  • Click Yes within the confirmation window to delete the Condition or Action.


    Note: Click No to close the window without deleting the Condition or Action.