Description
Two key components of a Test Data Case Suite are: Categories and Test Data Cases. Once at least one Test Data Category has been set up, you will be able to begin setting up Test Data Cases for the Category. Each Test Data Category can have as many Test Data Cases as needed.
What is a Test Data Case?
- A Test Data Case defines the Domains and Loop Counts to be generated when the Test Data Case Suite is run with a Scenario, Scenario Chain, or Scenario Chain Set.
When should you use Test Data Cases?
- Test Data Cases should be used when you want to define and build test data for a specified Test Data Category within a suite.
How do Test Data Cases Work?
Each Test Data Case Suite can have one or multiple Test Data Categories. Test Data Cases are created and managed within each Test Data Category.
- Select a Test Data Case Suite
- Select a Test Data Category
- Add a Test Data Case to the Test Data Category
- Add Domains to the Test Data Case
- Randomize Loop Counts for Test Data Case Domains
Note: Test Data Rules and Queries can be added to an individual Test Data Case within the G-Case Dashboard. To learn more, see these articles.
In This Article
This article covers the following topics:
- How to Create a New Test Data Case for a Category
- How to Add and Manage Domains for Test Data Cases
- How to Randomize Loop Counts for Test Data Case Domains
- How to Configure a Constant Domain Loop Count
- How to Configure a Random Domain Loop Count
- How to Change the Name and Description of a Test Data Case
- How to Delete a Test Data Case from a Category
Note: To learn more about creating and managing Test Data Categories, please see: How to create and manage Test Data Categories
How to Create a New Test Data Case for a Category
A Test Data Case contains the configured Domains and parameters necessary to generate a variation of synthetic test data.
To create a new Test Data Case, complete the following steps:
- Select the Test Data Case Suite within the table by clicking on its Name.
- Select the Test Data Category the case should belong to by clicking on its name.
- The currently selected category will be highlighted in blue. If only one category is present, it will be selected automatically.
- Click on Add G-Case within the Test Data Case section.
- Enter a Name and Description (optional but recommended) for the Test Data Case and click the Save button.
- The new Test Data Case will appear in the table as shown below and will be automatically selected.
Note: After a Test Data Case has been created, you will be able to add Domains to the case and randomize Domain Loop Counts. Please see the next section to learn more.
How to Add and Manage Domains for Test Data Cases
Once a Test Data Case has been created, you will be able to add one or more Domains from the Project, change their order, and remove them from the Test Data Case as needed.
Adding Domains to a Test Data Case
Domains displayed for a Test Data Case within the Case Editor are directly tied to the Test Data Case Suite and Project Version.
If the Domain is not part of the Project Version the Test Data Case Suite was created for, it will not be available to add to a Test Data Case.
To add one or more Domains to a Test Data Case, complete the following steps:
- When viewing the Test Data Case Suite, select the appropriate Test Data Case by clicking on its Name in the table.
- Within the Case Editor Tab, Click on the Plus (+) within the Actions Column to add each Domain to the Test Data Case.
Tip: By clicking on the Plus (+) in the order the Domains should be listed, you will not have to change the order at a later time. - The Filter input field can be used when working with several Domains for a Test Data Case.
- Type part or all of the Domain Name to find it faster in the table.
- The added Domains will appear within the table on the right side of the Case Editor.
Changing the Domain Order for a Test Data Case
The Domain Order can be changed at any time, by Clicking and Dragging a Domain either up or down within the table.
In the example below, Department is dragged from the second position to the last position within the table.
Removing Domains from a Test Data Case
If for some reason a Domain was added accidentally or simply needs to be removed, complete the following steps to do so:
- Select the appropriate Test Data Case by clicking on its Name in the table.
- Within the Case Editor, Click on the Minus (-) within the Actions Column to remove each Domain from the Test Data Case.
- Click Yes within the confirmation message to remove the Domain.
Note: Click No to close this message without removing the Domain from the Test Data Case. - Each removed Domain will appear within the table on the left and can be added to the Test Data Case again at any time.
Note: To add the Domain again, just click on the Plus (+) within the Actions Column.
How to Randomize Loop Counts for Test Data Case Domains
Each Domain added to a Test Data Case will default to the global loop count value (i.e. #{global.DomainName.loopCount}).
The Domain Loop Counts can be changed to set up different variations of generated data per Test Data Case.
Domain Loop Counts can be configured to:
- Reference the Global Domain Loop Count (i.e. global.DomainName.loopCount)
- Be a defined number (i.e. 3)
- Span a number range (i.e. 1 to 3).
- Populate randomly, in increasing or decreasing order, etc.
In the example below, the Domain Loop Count is 1 for all Domains, as this is the default global value.
Loop Count Configuration Options
Each Loop Count configuration option is specific to the selected Domain. If more than one Domain Loop Count for a Test Data Case must be configured, then it will need to be done separately.
The following can be configured for a Domain Loop Count:
- Loop Type - Determines how the Domain data is generated.
- Constant - This data will be generated for a constant value or can reference the Global Loop Count. If a Domain titled "Company" has this Loop Type and a Loop Count value of 3, then 3 Companies will be generated.
- Random - The data will be generated randomly based on the entered Min and Max Range. A Min Range and Max Range must be entered when this option is selected.
- Increasing - The data will be generated in an increasing order based on the entered Min and Max Range. A Min Range and Max Range must be entered when this option is selected.
- Decreasing - The data will be generated in a decreasing order based on the entered Min and Max Range. A Min Range and Max Range must be entered when this option is selected.
- Constant - This data will be generated for a constant value or can reference the Global Loop Count. If a Domain titled "Company" has this Loop Type and a Loop Count value of 3, then 3 Companies will be generated.
- Loop Count - The amount of data to be generated by the Test Data Case Suite. This value will only need to be entered when the Loop Type is set to Constant. If 10 is entered for a Domain titled "Department", then 10 departments will be generated.
- Min Range - The minimum number of data generated for the Domain within the test data. This value will only need to be entered when the Loop Type has been set to Random, Increasing, or Decreasing. For example, if this value is 1 for an Address Domain, then each individual record will have at least 1 address.
- Max Range - The maximum number of data generated for the Domain within the test data. This value will only need to be entered when the Loop Type has been set to Random, Increasing, or Decreasing. For example, if this value is 5 for an Address Domain, then each individual record could have as many as 5 addresses depending on the configuration.
- Seed - This value ensures that the randomly generated data for the Domain differs from randomly generated data for another Domain in the Test Data Case. It is not required to set up a Test Data Case. This value is only applicable when the the Loop Type is set to Random.
Randomization Example
A Test Data Case has four Domains (Company, Department, User, and Address). The following should be generated for each Domain:
- Company - 5 Companies
- Department - 10 Departments
- Users - 100 Users
- Address - 1 to 3 Addresses per User
The configuration would be as follows:
- Company: Loop Type = Constant; Loop Count = 5
- Department: Loop Type = Constant; Loop Count = 10
- Users: Loop Type = Constant; Loop Count = 100
- Address: Loop Type = Increasing; Loop Count = 3; Min Range = 1, Max Range = 3
For this example, the Test Data Case will generate: 5 companies, having 10 departments, having 100 users, with each user having 1 to 3 addresses.
Note: To see this in action, please take a minute to review this example: Test Data Case Suite Example: Unit and Load Testing
How to Configure a Constant Domain Loop Count
- Click on the Update Loop Count Icon located to the right of the current Loop Count for the Domain.
- In the pop-up window, select the Constant Loop Type from the drop-down menu.
- Next, enter 3 or the Loop Count. When the Loop Type is set to Constant and the Loop Count is set to 3, it means that 3 data instances will be generated for the Domain. In this case 3 companies will be generated.
- Once finished, click the Save button.
- The new Loop Count will be displayed in the table for the Domain, as shown below:
How to Configure a Random Domain Loop Count
To randomize the Loop Count for a Domain, complete the following steps:
- Click on the Update Loop Count Icon located to the right of the current Loop Count for the Domain.
- In the pop-up window, select the Random Loop Type from the drop-down menu.
- Next, enter 1 for the Min Range and 5 for the Max Range values. This means that the Loop Count will be randomly generated as a value of 1 to 5.
- Once finished, click the Save button.
- The new Loop Count will be displayed in the table for the Domain, as shown below:
Note: Increasing and Decreasing Loop Types have the same two parameters. When these are configured, the Loop Count will either increase from the Min Range to the Max Range or decrease from the Max Range to the Min Range for the Domain.
How to Change the Name and Description of a Test Data Case
A Test Data Case may be renamed at any time. To change the name, complete the following steps:
- Click on the Edit (Pencil) icon within the Actions Column for the Test Data Case.
- Click on the Name field to remove the current name and enter a new one.
- Click Save to finish.
How to Delete a Test Data Case from a Category
To delete a Test Data Case, complete the following steps:
- Click on the Delete (Trash Can) icon within the Actions Column for the Test Data Case.
- Click Yes in the confirmation window to delete the Test Data Case.
Note: Click No to close the confirmation window without deleting the Test Data Case.