Description

Once a Test Data Rule has been added to the set, 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 Value-Based Conditions to a Test Data Rule
  • Adding Variable-Based Conditions to a Test Data Rule
  • Action Configuration Options
  • Adding Value-Based Actions to a Test Data Rule
  • Adding Generator-Based 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 Sets, 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 Set 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). A value may be entered manually or double click to select a variable to reference.
Is StringNoThis box should be checked if the Condition is a String. It will be automatically checked if the entered value is a string.
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 Value-Based 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.

  • Click on the field once to enter a number or text value. 

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


Adding Variable-Based 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 qualifier Attribute will be used.

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


  • Next, double click on the Value field to reference to a Variable (Domain and Attribute). The variable will be used to evaluate the condition to determine if it has been met or not. 


  • Use the Filter option when many Domains are present. 

  • Click on a Domain to select it. The Domain's Attributes will appear to the right 


  • Next, click on a Plus (+) to select an Attribute.


  • The variable will appear similar to what is shown below:


  • 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 Value Column will show the referenced Domain and Attribute.


  • 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. An Action can be set up to do one of the following: 

  • Assign a specific value to the selected Attribute 
  • Use a Generator to assign the value to the selected Attribute


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.
Value TypeYesThis is the value type that will be used to assign the value to the attribute:
  • Constant - A defined string, number, or other value (true, false, yes, no, 100, etc.).
  • Generator - The selected Generator will assign a value.
ValueYesThis is the Value that will be assigned when a Condition is met. 

It is required when Constant is chosen for the Value Type.

For example: If User.age < 18, Then User.allowedtoVote = false.
"false" is the assigned Value in this example.
Select GeneratorYes
The selected Generator(s) will be used to assign a value to the selected Domain Attribute when a Condition is met. 

It is required when Generator is chosen for the Value Type.

For example: If User.age >= 18, Then User.voterRegistrationNumber will have a value assigned from RandomGen Generator. This generator will assign a random number as the user's voter registration number. 
Is StringNoThis box will automatically be checked when the entered Value is a String and may be altered when needed.


Adding Value-Based Actions to a Test Data Rule

To add an Action using a Constant Value 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.


  • Select Constant for the Value Type.

  • 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 will be automatically check when the entered value is a string and not checked for numeric values.

  • Click Save to finish.


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


Adding Generator-Based Actions to a Test Data Rule

To add an Action with a selected Generator 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 the voterRegistrationNumber Attribute have been chosen.


  • Select Generator as the Value Type.


  • Click on the Select Generator field and enter part or all of the Generator name.

  • You may also select the Generator from the provided drop-down menu.


  • In this example, the RandomGen Generator will be chosen.

  • Click Save to finish.


  • You will be redirected to the Generator Management Dashboard to make configuration changes for the selected Generator.

  • For this example, a startRange and endRange are required. The range has been set between 10000 and 15000.

  • Click Save Generator once the required changes have been made.


  • Click on the Test Data Rule Set Name within the breadcrumb bar to view the configuration.


  • 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 with a constant value.


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.