Description

A Test Data 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. 


Note: This article shows you how to manually run a Test Data Query using the command line in a Command or Terminal Window. 


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. 


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

  • Select the a Project and Project Version in the Project Dashboard
  • Download a Scenario, Scenario Chain, or Scenario Chain Set
  • Download the Test Data Query
  • Open a Command or Terminal Window
  • Enter the Command Line and run the Test Data Query


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


Note: In the Self-Service Test Data 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, you do not need to download and run the Test Data Query command line. This is because it will be run automatically when the Test Data Case is run in GenRocket Runtime. 


In This Article


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 Self Serve Menu Options drop-down menu 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: (Optional) Copy the Test Data Query Command

The command for a Test Data Query can be manually entered or pasted into the Command/Terminal Window. To ensure accuracy, you can select a Test Data Query and copy the command at the bottom of the G-Queries Dashboard. 



Step 3: 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) icon in the appropriate pane. 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 4: Open a Command or Terminal Window

Open a Command 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.



Step 5: Enter/Paste the Command Line and Run the Test Data Query

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

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


  • Enter or Paste the command line into a Command or Terminal Window.


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

  • Next, press the Enter key to run the command.

     

Note: After the Test Data Query and Scenario have been run, you can open the file or access the location 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