Introduction

With GenRocket, you can generate any type of needed synthetic test data 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 comes in.


Test Data Queries enable the blending of synthetic test data with real data. Within GenRocket, you can query real data from a database or CSV file.


This data can then be conditioned and blended with synthetic test data and applied to any Scenario, Scenario Chain, or Scenario Chain Set.


Four Types of Queries

GenRocket Test Data Queries gives four types of query options:

  • Query Before - Query columns from one or more database tables as a set of data that is buffered into memory.  
  • Query Each - Query one row of columns, from one or more database tables, on each row iteration of test data generation.  
  • CSV List - From a CSV file, pull rows of data having one or more columns, into memory as a list of data.  
  • CSV Index - From a CSV file, pull rows of data having one or more columns, into memory and retreive any row via its row index.  


Video Overview

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


How Do I Use Test Data Queries?

In just a few steps, you can define a Test Data Query.

  1. Select the Test Data Query Menu Option
  2. Define a new Test Data Query
  3. Set your query parameters
  4. Define your query
  5. Select your Domain and Attributes that will receive the queried data

Defining a Test Data Query Example

Story

A QA Tester needs to generate customer test data, but specific customer attributes need real data that need to be blended with other synthetically generated data.  And the real data must be queried from a database.  


Let's follow the steps to create our Test Data Query.


Select the Test Data Query Menu Option

Within a given Project Version, from the Project Versions pane, select the Test Data Queries menu option from the Manage pulldown.

 

Define a new Test Data Query

  • Click the Add New Test Data Query button
  • Give your Test Data Query a unique name
  • Optionally add a description (it's really a good practice to add a description)
  • Select the type of Query you want to define



Set your query parameters

Much like GenRocket Generators, each of the four Query Types has a set of parameters that are used to customize your query. 



Define your query

In our example, we are defining a query join that will retrieve data from two tables to treat the data as a one customer entity.



Select your Domain and Attributes that will receive the queried data

We will add Attributes from a User Domain and an Address Domain, and map them to the columns in the query.

Here's a view adding the User.firstName Attribute and mapping it to the first_name column from the query.



Here's a view after all  of the necessary User and Address Domain Attributes have been mapped.



The Completed Story

In just a few minutes we are able to define a query to join and pull data from two tables to generate real customer data that can be blended with other synthetically generated data.  And best of all, this Test Data Query can be used to modify any Scenario, Scenario Chain, Scenario Chain Set or added to any Test Data Case.