Description

A Test Data Query (or G-Query) is performed when the command line is run within a Command or Terminal Window. Depending on query configuration, the database or CSV file will be queried before or on each iteration during test data generation. This is one way you can deploy your designed test data. 


When should you download and run a Test Data Query?

A Test Data Query should be downloaded and run when you want to generate synthetic test data and blend it with real data queried from a database or CSV file. 


In the Self-Service Portal, you also have the ability to add a Test Data Query to a Test Data Case. When a Test Data Query has been added to a Test Data Case, these steps do not need to be performed because it will be run automatically when the Test Data Case is run in GenRocket Runtime. Please refer to How to download and run Test Data Cases for more information.


How do I generate test data with a Test Data Query?

  • Select the Project and/or Project Version
  • Download a Scenario, Scenario Chain, or Scenario Chain Set
  • Select G-Queries from the Manage Menu.
  • Download the Test Data Query
  • Open a Command or Terminal Window
  • Enter the Command Line for the Test Data Query


Note: The assigned Receiver will determine where the blended data is saved during this process. For example, if the DelimitedFileV2Receiver has been assigned, then a delimited file will be created with the blended data records. 


Step 1: Download a Test Data Query

Once the Test Data Query has been configured, you will need to download the Test Data Query to your local machine. 

  • Expand the Manage Menu option for the appropriate Project Version within the Project Dashboard.

  • Next, select G-Queries from the menu.



  • Click on the Download (Cloud) option located on the far right of the table in the Action Column to download it to your local computer.


Step 2: Download a Scenario, Scenario Chain, or Scenario Chain Set


Note: While this article shows how to run the Test Data Query specifically with a Scenario, the same steps are applicable for Scenario Chains and Scenario Chain Sets.


A Scenario, Scenario Chain, or Scenario Chain Set can be downloaded directly from the Project Dashboard by clicking on the Download (Cloud). The image below shows this for a Scenario in the Scenarios Pane.


Note: To learn more about downloading Scenarios, please see: How to Download a Scenario.


Step 3: Run the Test Data Query in a Command or Terminal Window

The Test Data Query and the Scenario (or Scenario Chain/Scenario Chain Set) are run using the following command line: 



These values will be different depending on the name of the Test Data Query and the Scenario to be run.

  • AddressQueries.gtdq - Name of the Test Data Query to be run.
  • <ScenarioName.grs> - Name of the Scenario, Scenario Chain, or Scenario Chain Set to run.


Open a CMD or Terminal Window and set the directory to where files are downloaded from the GenRocket web platform to your local computer. The following images show the command line in a CMD window.



Then replace the appropriate values within the command line. The Test Data Query Name and Scenario Name can be changed accordingly.

 

Note: After the Test Data Query and Scenario have been run, you can open the file or view the located where the data was inserted to view the generated test data and verify the information is correct. 


Sample Output

In the example below, a Customer Table within a MySQL Database has been queried for the following columns of real data: 

  • first_name
  • last_name
  • middle_initial



This real data will be combined with the following synthetically generated test data in a delimited file (shown below): 

  • address
  • city
  • state
  • zipCode
  • ssn