DesignTest Data Engineer (TDE), Org Admin


Description

Test Data Queries are a key part of GenRocket's Self Service Test Data Portal. We organize all the Test Data Query functionality into a part of the GenRocket platform we call "G-Queries" (also referred to as "GQueries" in some articles).


With GenRocket, you can generate any type of synthetic test data needed to solve your test data challenges. However, synthetic test data does not always provide the data you require. Sometimes, real data needs to be queried and blended with synthetic test data to meet specific testing goals. This is where Test Data Queries come in.


Test Data Queries enable the blending of synthetic test data with real data. Within GenRocket, you can query real data from a database, CSV, or Excel file. This data can then be conditioned and blended with synthetic test data and applied to any Scenario, Scenario Chain, or Scenario Chain Set independently or with a Test Data Case.


In This Article


Overview Video

Please take a few minutes to watch the following video showing the power and flexibility of GenRocket Test Data Queries:


When Should Test Data Queries Be Used? 

  • Any time real data needs to be blended with synthetically generated test data to meet specific testing goals.

  • A Test Data Query can be used to modify any Scenario, Scenario Chain, or Scenario Chain Set or added to any Test Data Case.


What Are the Benefits of Queries?

  • Allows users to query data from a database or file and blend it with synthetic data when generating test data. 
  • Allows users to perform queries using complex joins and to query for Attributes in multiple Domains.


How to Access G-Queries

  • Select G-Queries from the Self Serve Menu Options menu.


Seven Types of Queries

GenRocket Test Data Queries gives seven types of query options:


Query TypeDescription
Query BeforeQuery columns from one or more database tables as a set of data that is buffered into memory.
Query EachQuery one row of columns from one or more database tables on each row iteration of test data generation.  
CSV ListFrom a CSV file, pull rows of data having one or more columns into memory as a list of data. 
CSV IndexFrom a CSV file, pull rows of data having one or more columns into memory and retrieve any row via its row index. 
Mongo BeforeQuery columns from one or more database collections as a set of data that is buffered into memory. This is the same as Query Before but designed specifically for use with Mongo.
Mongo EachQuery one row of columns from one or more database collections on each row iteration of test data generation. This is the same as Query Each but designed specifically for use with Mongo.
Excel ListFrom a sheet within an Excel file, pull rows of data having one or more columns into memory as a list of data.



Sample SQL Query

In the query below, six columns of data will be queried within a User table. Each column in the table represents an Attribute within a User Domain. The data being queried is for department '2' only.


select id, first_name, last_name, middle_initial, department_id, role_id
from user
where department_id = 2;


HTML

When test data is generated, the queried data will be combined with data generated by other Attributes within the Domain to provide the following blended output. 



Prerequisite Steps

  1. GenRocket Runtime has been installed either locally or on a server. 
  2. A config.properties file has been created to connect to the database and query data.
  3. Organization Resources have been configured appropriately.
  4. A Project/Project Version has been created or is available. 
  5. Domains have been created or imported into the GenRocket web platform (varies depending on the source)
  6. Parent/Child Relationships have been configured (for multiple Domains). 
  7. The appropriate Receiver has been assigned to the Domain. Varies based on the required output format: 
    • Directly insert into a Database (e.g., GenericSQLInsertReceiver, MongoDBInsertReceiver). 
    • Insert data into a Database using a file.
    • Generate data in a different format (e.g., DelimitedFileReceiver, PDFFileReceier, JSONFileReceiver).
  8. A Scenario has been created for the Domain.
     

How do Test Data Queries Work?

  1. Add a new G-Query to the Project Version.
  2. Configure the query parameters to customize the query. 
  3. Define the query. Data can be retrieved from a single table or multiple tables.
  4. Select the Domain and Attributes that will receive the queried data.
  5. Copy the command line and download the query to run it with a downloaded Scenario.


Note: Queries can be added to a Test Data Case. The query will be performed when the case is used to generate data. Please note that adding a large number of queries to a G-Case can slow down test data generation. 



Additional Information

For more information, please see these additional articles regarding Test Data Queries:

TopicDescription

How to Add and Setup a Database Query

Learn more about configuring a database Query. 

How to Add and Setup a CSV Query

Learn more about configuring a CSV file Query.

How to Add and Setup a MongoDB Query

Learn more about configuring a MongoDB Query.
How to Add and Setup an Excel List QueryLearn more about configuring an Excel List Query.
How to Add Queries to a Test Data Case
Learn how to add a Query to a Test Data Case.
How to Generate Test Data with Queries and a ScenarioLearn more about generating test data with Queries and a Scenario.