Test Data Cases (or G-Cases) are used to define the volume and variety of test data that is needed (e.g., Unit Testing, Negative Testing, Performance Testing, etc.).
Once cases have been added and defined, users can generate their test data using a G-Case and Scenario, Scenario Chain, or Scenario Chain Set.
To generate data, users must run a command at the command line or use a script when integrating with an automation tool.
In This Article
- Prerequisite Steps Before Test Data Generation
- Three Ways to Get Required Files and Command
- Can Cases be Run with any Scenario?
- How to Manually Download a Case Suite
- How to Manually Download One or More Cases in a Suite
- How to Generate Test Data Using Cases
Prerequisite Steps Before Test Data Generation
The following steps must be completed before a user will be able to generate data using G-Cases:
- (Recommended) Set up G-Repository Server/Client.
- Create a Project with the default Project Version (or use an existing one).
- Import or Create Domains
- Set Parent/Child Relationships at Domain Level
- Add a Receiver and Create a Scenario for each Domain
- Add a Case Suite, Categories, and Cases.
- Modify Attributes, Generators, and Receivers per Case as needed.
Three Ways to Get Required Files and Command
User steps vary depending on how the cases were created and how GenRocket has been set up within your organization.
- G-Repository (Best Practice) - Users do not have to download files. They only need to run the command at the command line or use the required script. Click here for more information.
- G-Cases Management Dashboard - Users can manually download an entire suite or individual cases and copy the command line from the G-Cases Management Dashboard (shown in this article).
- G-Questionnaire Management Dashboard - Users can manually download an entire suite or individual cases and copy the command line from within the G-Questionnaire Management Dashboard. Click here for more information.
Note: If Rules or Queries have been added to a G-Case, they do not have to be downloaded to generate test data.
Can Cases be Run with any Scenario?
- Cases may be run with any Scenario, Scenario Chain, or Scenario Chain Set within a Project containing one or all specified Domains.
How to Manually Download a Case Suite
Click on the Download (Cloud) option on the far right of the table in the Actions Column to download a Test Data Suite to your local computer.
How to Manually Download One or More Cases in a Suite
Important: Remember to use the Case File Name in the command if changed in the screen above.
genrocket -tdc <TestDataCaseFileName>:<CategoryName.CaseName> -r <ScenarioName.grs>
genrocket -tdc BankingSuite.gtdc:Integration.mediumSetup -r <ScenarioName.grs>
How to Generate Test Data Using Cases
- Step 1 - Download Required Files (When not using G-Repository)
- Step 2 - (Optional) Copy the Command Line from the G-Case Dashboard
- Step 3 - Run the Command at the Command Prompt or Terminal Window
Step 1 - Download Required Files (When not using G-Repository)
Use the Download (Cloud) icon to download any needed files. This step will vary based on how GenRocket has been set up and may include:
- Case Suite or Individual Cases (G-Cases Management Dashboard)
- Questionnaire Suite or Individual Cases (G-Questionnaire Management Dashboard)
- Scenario, Scenario Chain, or Scenario Chain Set (Project Dashboard)
- Any Required Configuration Files (Project Dashboard)
Step 2 - (Optional) Copy the Command Line from the G-Case Dashboard
The command line can be found at the bottom of the dashboard. The displayed command is based on the selected Suite, Category, and Case.
Select and copy the command within the dashboard. When running the command, remember to change <ScenarioName.grs> to the actual Scenario name.
Step 3 - Run the Command at the Command Prompt or Terminal Window
The Receiver assigned to the Domain determines the output format of the generated test data. Depending on what has been assigned, the output may be generated as a file, inserted into a database, etc.
- Open a Command Prompt or Terminal.
- Set the directory to where the files are downloaded to the local machine (when not using G-Repository).
- Enter or paste the command line. Be sure to replace the appropriate values.
- Press the Enter Key on your keyboard to run the command.
Note: Step 3 may differ when integrating with an automation tool in your CI/CD pipeline. Please see this section for more information: GenRocket Integrations.