Description
A Test Data Query imports column data from a CSV file and can be performed in one of two ways: CSV List and CSV Index. When data is imported from a CSV File, the imported data is populated into the defined Domains and Attributes within the configuration and blended with synthetically generated data.
What is a CSV file?
- A text file where the values are separated by a comma or another type of delimiter.
When should you use a CSV List or Index Query?
- Any time you want to query real data from a CSV File and blend it with synthetically generated data.
How do you configure CSV File Queries?
- Create a CSV File Test Data Query
- Configure the Query Parameters
- Import the CSV File into the Query
- 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.
Sample Customer CSV Query
In This Article
- Step 1: Configure Test Data Query Parameters
- Step 2: Import the CSV File
- Step 3: Add Domain Attributes and Columns
Note: For the CSV List and CSV Index query options, the setup process is the same. Only the parameters are different for these options.
Step 1: Configure Test Data Query Parameters
Test Data Query Parameters define any resources and variables to be used during the query. Available parameters within the Parameters Pane will vary based on the type of query.
CSV List Parameters
Items with an asterisk (*) are required to perform this type of Test Data Query.
- path* - Defines the path where the CSV file is located.
- subDir - Defines an optional subdirectory under the resourcePath where the CSV file exists.
- 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.
- bufferSize* - Defines how many rows to keep in memory at once from the CSV in order to avoid the memory out of exception. Defaults to 1000.
- setLoop* - setLoop gives you the ability to OVERRIDE the loop count at the Scenario level and ONLY produce the number of rows that are defined in this list. Defaults to False.
Note: Remember to click Save after making changes to the parameter configuration.
CSV Index Parameters
Items with an asterisk (*) are required to perform this type of Test Data Query.
- path* - Defines the path where the CSV file is located.
- subDir - Defines an optional subdirectory under the resourcePath where the CSV file exists.
- fileName* - Defines the name of CSV file located on the user's computer.
- dilimiter* - Defines what delimiter is used to separate column data within the CSV file.
- rowIndex* - References an Attribute whose value determines the row in the CSV file to index in realtime. If the parameter is set to 4, the Generator will always return the 4th value of the CSV file.
Note: Remember to click Save after making changes to the parameter configuration.
Step 2: Import the CSV File
After the appropriate parameters have been configured, you will need to import the CSV File.
- Click on Import within the CSV File Column Names pane.
- Click on Choose File to select a local file from your computer.
- Browse to the file, select it, and click on Open.
- Click Save to import the file.
- The file columns will appear within the CSV File Column Names pane, as shown below:
Step 3: Add Domain Attributes and Columns
To finish the configuration, you will need to add the Domain Attributes that will be populated with data read from the CSV File columns for the Test Data Query. This will need to be done for each queried column of data in the CSV file.
- Click on Add below the Domain/Attribute/Column table.
- Select the Domain and Attribute from the drop-down menus.
- Enter the name of the Column being read by the query in the CSV file.
- Click Save to finish.
- The new Domain Attribute will appear in the table as shown below:
Note: Options in the Action Column can be used to edit or delete a Domain Attribute from the Test Data Query configuration. - You can verify this configuration by clicking on the Column Check button.
- A Notification dialog window will appear to show if the setup is valid. Click OK to close the dialog window.