Description
Test Data Cases are a key part of GenRocket's Self Service Test Data Portal. We organize all the Test Data Case functionality into a part of the GenRocket platform we call "G-Cases."
When should you use Test Data Cases?
- Any time you want to define and build test data.
How do you use Test Data Cases?
- Create a Test Data Case Suite to organize the Test Data Cases into a group of cases
- Create different Test Data Categories (e.g., Unit, Load, Integration, Negative)
- Build out your different Test Data Cases with Test Data Case Domains, Loop Counts, etc.
In This Article
- Overview Video
- Next Video in the Test Data Cases Training Series
- Helpful Definitions
- Can Domain Relationships be Defined at the G-Case Level?
- How Do Test Data Case Suites Work?
- Defining a Test Data Case Example: Load Testing
- Additional Training Examples
- Additional Information
Overview Video
Please take a minute to view the following videos showing how Test Data Cases work in GenRocket:
Next Video in the Test Data Cases Training Series
Helpful Definitions
The following concepts are key to this feature:
- Test Data Case Suite - A group of Test Data Categories with their own Test Data Cases, which can be used to test the validity of synthetic data used for your system. Test Data Case Suites exist within a given Project Version of a Project.
- Test Data Category - Defines the type of testing that will be performed (unit, load, beta, etc.) and can contain one or multiple Test Data Cases to meet your specific needs.
- 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.
Can Domain Relationships be Defined at the G-Case Level?
- No, they cannot be defined at this level in the GenRocket platform.
- They must be defined at the Domain (Template) level for a Domain to reference Attributes within another Domain.
- If a Domain Attribute is referenced by another Domain within a G-Case and these relationships have not been defined, a runtime error will occur when attempting to generate test data.
How Do Test Data Case Suites Work?
- Step 1: Select the G-Cases Menu Option
- Step 2: Create a Test Data Case Suite
- Step 3: Add Test Data Categories to the Suite
- Step 4: Add Test Data Cases to each Category
- Step 5: Add Domains to each Test Data Case
- Step 6: Alter Domain Loop Counts for each Test Data Case
- Step 7: (Optional) Add New Attribute(s) to a Test Data Case Domain
- Step 8: (Optional) Modify an Existing Attribute's Configuration within a Test Data Case Domain
- Step 9: (Optional) Add Test Data Rules to a Test Data Case
- Step 10: (Optional) Add Test Data Queries to a Test Data Case
- Step 11: Download the Test Data Case Suite
- Step 12: Run a Test Data Case in a Command or Terminal Window
Defining a Test Data Case Example: Load Testing
Story
A QA Tester needs to generate user test data to perform a Load Test. For this Load Test, the tester needs to generate the following data:
- 5 Companies
- 10 Departments
- 100 Users
- 1 to 3 Addresses per User
Let's follow the steps to create our Test Data Case Suite with a Test Data Case for this Load Testing example.
Step 1: Select the G-Cases Menu Option
Expand the Self Serve Menu Options drop-down menu within the Project Versions Pane and select G-Cases. Test Data Cases are specific to a Project Version within a Project.
Note: For detailed steps on accessing and viewing Test Data Case Suites, click here.
Step 2: Create a Test Data Case Suite
A user can set up their own Test Data Case Suite for testing purposes without affecting others who may be using the same information to generate their own data. Multiple Test Data Case Suites can be created within a given Project Version and contain their own Categories and Test Data Cases.
Note: For detailed steps on creating a Test Data Case Suite, click here.
Step 3: Add Test Data Categories to the Suite
A Test Data Case Suite can have one or multiple Categories. A Category represents the type of testing the data will be generated for (Beta, Load, Unit, Stress, Integration, Performance, etc.).
Note: For detailed steps on adding Categories to a Test Data Case, click here.
Step 4: Add Test Data Cases to each Category
Each Test Data Case defines what Domain data will be generated and how many records will be generated for each Domain (i.e., loopCount). At least one Domain will need to be added to a Test Data Case Category.
Note: For detailed steps on adding Test Data Cases to a Category, click here.
Step 5: Add Domains to each Test Data Case
Domains should be added to a Test Data Case in the order that you want test data to be generated. You can add one Domain or many Domains based on your specific needs.
Note: For detailed steps on adding and managing Domains for a Test Data Case, click here.
Step 6: Alter Domain Loop Counts for each Test Data Case
The Loop Count defaults to what has been set for the Domain's Global Variable value. The Loop Count can be changed for each Domain within a Test Data Case to alter the amount of test data that is generated. It can reference the Global Variable value or be one of the following:
- Constant - A constant value (e.g.) Domain Global Loop Count or a Number Value)
- Random - A random value from a defined range (e.g., 1 to 3).
- Increasing - Increasing based on a defined Min and Max range.
- Decreasing - Decreasing based on a defined Max and Min range.
Note: For detailed steps on altering Domain Loop Counts for a Test Data Case, click here.
Step 7: (Optional) Add New Attribute(s) to a Test Data Case Domain
Every Attribute at the Domain Level is included in the Test Data Case Domain by default. The Domain Level is a template that can be used and built upon.
Additional Attributes may be added to a Test Data Case Domain. These Attributes will only be used during test data generation when that particular Test Data Case is run by GenRocket Runtime.
This is helpful when you want to use a Test Data Case to generate your data and need one or more additional Attributes that should only be available at the Test Data Case Domain Level for a Project Version.
Note: For detailed steps on adding a new Attribute to a Test Data Case Domain, click here.
Step 8: (Optional) Modify an Existing Attribute's Configuration within a Test Data Case Domain
Within a Test Data Case Domain, you can add one of the Attributes that has been configured at the Domain Level and then make Generator/Parameter configuration changes that are specific to the selected Test Data Case Domain. These changes do not impact the Attribute at the Domain Level and are specific to the Test Data Case Level.
Let's say, for example, you want to perform negative testing on a Customer SSN. By default, the SSNGen will be assigned to the Attribute at the Domain Level. However, the SSNGen on its own will use the Luhn algorithm to generate valid SSNs.
If you need every 4th SSN to have a negative value, then changes will need to be made to the Generator configuration to produce this type of data during test data generation.
Once the Attribute has been added to the selected case, you will be able to link additional Generators and make Parameter configuration changes to achieve this type of testing goal.
Note: For detailed steps on how to add existing Attributes to a Test Data Case Domain and alter their configuration, click here.
Step 9: (Optional) Add Test Data Rules to a Test Data Case
As part of our Self-Service Test Portal, a Test Data Rule Suite may be added to a Test Data Case to apply business logic during test data generation. This allows the rules to be applied when a Test Data Case is run without having to perform additional steps.
Note: For detailed steps on adding Test Data Rules to a Test Data Case, click here.
Step 10: (Optional) Add Test Data Queries to a Test Data Case
As part of our Self-Service Test Data Portal, Test Data Queries may be added to a Test Data Case to query real data and blend it with synthetic data during test data generation. One or multiple queries may be added and applied when a Test Data Case is run without additional steps.
Note: For detailed steps on adding Test Data Queries to a Test Data Case, click here.
Step 11: Download the Test Data Case Suite
Once a Test Data Case Suite has been set up, it can be downloaded to the tester's local machine. A Test Data Case within a Suite can be run with any Scenario, Scenario Chain, or Scenario Chain Set within the Project containing all or some of the Domains used to configure the Test Cases. The defined Receivers will be used to generate the output data.
Note: You will need to download the Scenario, Scenario Chain, or Scenario Chain Set to be used during test data generation as well.
Step 12: Run a Test Data Case in a Command or Terminal Window
To run a Test Data Case, you will need to use the provided command line within the Test Data Case Dashboard. Select the Test Data Case you want to run to view the command line for that case:
Note: For detailed steps on how to download and run a Test Data Case Suite, click here.
The Completed Story
We can define a simple Test Data Case Suite for performing a basic Load Test in just a few minutes. This Test Data Case Suite can be downloaded and used to modify any Scenario, Scenario Chain, Scenario Chain Set. The complete Test Data Case will appear as shown below:
Additional Training Examples
To view more examples for Test Data Cases, click on one of the links below:
Topic | Description |
Test Data Cases Training: Unit Testing | View a solutions video for Unit Testing. |
Test Data Cases Training: Database Type Tables | View a solutions video for Database Type Tables |
Test Data Cases Training: Integration Test Data | View a solutions video for Integration Test Data. |
Test Data Cases Training: Negative Test Data | View a solutions video for Negative Test Data. |
View a solutions video for Permutations and Combinations . | |
Test Data Case Suite Example: Unit and Load Testing | View a full example for Unit and Load Testing. |
Additional Information
Topic | Description |
How to access and view Test Data Case Suites | Learn how to access and view G-Case Suites. |
How to create a New Test Data Suite for a Project Version | Learn more about creating new G-Case Suites. |
How to create and manage Test Data Categories | Learn more about creating and managing G-Case Categories. |
How to create and manage Test Data Cases | Learn more about creating and managing G-Cases. |
How to add Test Data Rule Suites to a Test Data Case | Learn more about adding G-Rules to a G-Case. |
How to add Test Data Queries to a Test Data Case | Learn more about adding G-Queries to a G-Case. |
How to add and modify Attributes within a Test Data Case Domain | Learn more about adding and modifying Attributes within a G-Case Domain. |
Deploy: How to download and run Test Data Cases | Learn more about generating test data with G-Cases. |
How to create a copy of a Test Data Case Suite | Learn more about copying G-Case Suites. |
How do I change the name of a Test Data Case Suite? | Learn how to change the name of a G-Case Suite. |
How to view Test Data Case Suite Reports | Learn more about G-Case Suite reports. |
How to lock and unlock Test Data Case Suites | Learn more about locking and unlocking G-Case Suites. |
How to delete a Test Data Suite from a Project Version | Learn more about deleting G-Case Suites from a Project Version. |
How to toggle Domain Attributes on/off within the G-Case Editor | Learn more about toggling Domain Attributes on and off within the G-Case Editor. |
How to remove Attributes from a G-Case Domain | Learn more about removing Attributes from a G-Case Domain. |
How to use the Domain Tree View in G-Cases | Learn more about the Domain Tree View. |