Description

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

The following steps must be completed before a user will be able to generate data using G-Cases: 

  1. (Recommended) Set up G-Repository Server/Client.
  2. Install GenRocket Runtime on the User Machine.
  3. Create a Project with the default Project Version (or use an existing one). 
  4. Import or Create Domains
  5. Set Parent/Child Relationships at Domain Level
  6. Add a Receiver and Create a Scenario for each Domain
  7. Add a Case Suite, Categories, and Cases.
  8. 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.  

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

  2. 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).

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

The Selective Test Data Case Download feature mitigates download issues for large Test Data Suites or G-Case Suites. 


This feature makes it possible to select individual Test Data Cases within a Category and download a Test Data Case File that contains only the selected Test Data Cases to a user's local machine. Complete the following steps to do so: 


  • Select a G-Case Suite within the dashboard.
  • Click on the Download (Cloud) Icon for the category.


  • Select the checkbox for each case and click Download,
  • (Optional) Change the file name. The default name is the same as the case suite, which allows the same command to be used.
    .


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>

Example:
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)

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.