UI How to Configure a CSV File Test Data Query (or G-Query)

In this lesson, you will learn how to complete a CSV File Test Data Query configuration. For this lesson, we will be creating a new G-Query.

How do you configure CSV File Queries?

  1. Create a CSV File Test Data Query (CSV List or CSV Index)
  2. Configure the Query Parameters
  3. Import the CSV File into the Query
  4. Add Domains and Attributes for the Real Data to Populate

2 Types of CSV Queries

A Test Data Query imports column data from a CSV file and can be performed in one of two ways:

  • 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 retrieve any row via its row index.

CSV File Query Configuration Components

A Test Data Query configuration has the following primary components:

  • Parameters – Define the resource path, subdirectory, name, and variables for the Test Data Query.
  • CSV File Column Names – Select a CSV file to be imported for the Test Data Query. Displays the column names within CSV file after imported.
  • Domain Attributes – Defines the Attributes that will be populated by the real data obtained from the imported file.

Step 1: Create a CSV File G-Query

Click on the Add G-Query button to add a new G-Query.

Next, enter a Name and Description for the G-Query.

Select a CSV Query option. For this example, CSV List will be chosen. Click the Save button.

Now that the G-Query has been created, you can configure its Parameters, import the CSV file, and add Domains and their Attributes.

Step 2: Configure the Query Parameters

For this example, we will be querying an Address CSV File. We will be configuring the following Parameters:

  • fileName* – Defines the name of CSV file located on the user’s computer.
  • delimiter* – Defines what delimiter is used to separate column data within the CSV file.

You can click on a field to enter a value or double click to add a reference. Click the Save button once finished.

Note: Parameters displayed within the Parameters Pane will vary per Query Type.

Step 3: Import the CSV File

Click the Import button to import the CSV File.

Click Choose File within the Import CSV dialog window.

Browse to and select the file. Then, click the Save button.

Each column within the file will be displayed after the CSV file is imported.

Step 4: Add Domains and Attributes

Next, you will need to add each Domain and Attribute. These steps will need to be completed for each column that is being queried within the CSV file.

Click on the Add button to add a Domain and Attribute.

Select a Domain and Attribute within the dialog window.

Select a Column Name for the CSV file within the drop-down menu and click the Save button.

The completed configuration for this Domain and Attribute is shown below:

The completed configuration for ALL Domains and Attributes is shown below:

Click on the Column Check button to perform a column check validation for the added Domains and Attributes.

If everything has been configured correctly for the Domains and Attributes, you will see the following message. Click OK.

Completed CSV File Query Configuration

Once a G-Query has been created, you can download the Query and run it with a downloaded Scenario, Scenario Chain, or Scenario Chain Set.

The command line is provided at the bottom of the G-Queries Management Dashboard for the selected G-Query.

To run the command, paste it into a Command Prompt or Terminal Window and then replace with the actual name of the Scenario, Scenario Chain, or Scenario Chain Set.

Note: G-Queries can also be added to an individual Test Data Case or G-Case. We will show how to add a G-Query to a G-Case in the next lesson of this training module.

Generated Data for the Address Domain

For this example, we will show the output as a delimited file. The G-Query was run with an AddressScenario.

This data can be output in several other formats and we have used this one to keep it simple.

If you compare the above output with the CSV File records, you will see they are identical:

In the next lesson within this module, we will show how to add G-Queries to a Test Data Case or G-Case.

Link:

https://genrocket.freshdesk.com/a/solutions/articles/19000106101

Related Assets

GenRocket - Test Data Management

Download Literature

View Literature
GenRocket - Test Data Management

Databases: How to configure a Test Data Query

A Test Data Query performs an SQL query on the defined database resource.

Read More
GenRocket - Test Data Management

How can we help
you today?