Description

The ListCSVIndexGen Generator allows the loading of data from a CSV file by the column index. This Generator loads the data into the list in memory BEFORE the 1st iteration of test data generation.


In This Article


Generator Parameters

The following parameters may be configured for the ListCSVIndexGen Generator. Items with an asterisk* are required. 

  • filePath* - Defines the path on a user's local machine where the CSV file exists.
  • fileSubDir - Defines an optional subdirectory under the filePath where the CSV exists.
  • fileName* - Defines the name of the CSV file that contains the column from where the data needs to be read.
  • columnIndex* - Defines the column's index from where the data must be read. The index starts with 0. e.g., the third column will have an index of 2.
  • delimiter* - Defines the delimiter that separates the columns in the CSV file.
  • setLoop - Gives the ability to override the loop count at the Scenario level to only produce the number of rows that are retrieved from the CSV file.
  • waitAmount - Defines the number of iterations the Generator should wait before moving to the next value from the list.
  • setLoop* - Defines whether the size of the list should be used to set the Scenario loop value.
  • sortOrder* - Defines whether the list should be sorted and, if so, in ascending, descending, or random order.
  • seed - Defines an optional seed for randomization. Using the seed will ensure that the same random data is generated each time data is generated as long as the values retrieved from the query are the same.
  • iterate - Based on the Boolean value, determines when to generate the next value. If the value is true, it generates the next value. If the value is false, it just waits.
  • startIndex* - Defines the index in the list where to start from.
  • jumpAmount* - Defines the amount to add to the index of generated value.
  • list - Stores one value on each line in the list. To add values, type them in and hit ENTER. Note that the listed value shown is only for simulation mode; when running an actual Scenario, the data will be loaded from the specified resource.


Preview Showing Empty Values - List Parameter

The ListCSVIndexGen generator reads the data from the given CSV file and loads the data while running the Scenario on the user's system locally. 


The list parameter can be used to simulate data displayed in the Preview pane on the GenRocket web app. 



If no values are entered for the list parameter, the preview will show Empty values for each record. 


When users add values to the list parameter, this data is simulated for preview only. The added values will appear in the Preview pane.



Example Story

Actors

  • Tester - The QA Tester that wants to generate the test data.
  • User - The object of data needed to be synthetically generated.

Key Components

  • Employee CSV file - A CSV file that contains employee information.
  • employeeCode - A value, safe for public access, that uniquely identifies a User in the Employee CSV.


Plot

  • A Tester wants to retrieve the Employee's employeeCode, from the Employee CSV and blend the employeeCode value with other synthetically generated values like the user's first name, last name, address, city, state, and zip code.


Employee CSV File

This is a preview of the Employee CSV file data available in the tester environment in the output directory.



User Domain

This is a preview of the User Domain data on the GenRocket web platform.



  • Within the GenRocket Web Platform, the Tester will create a new Project.

  • Within the Project,  the Tester must create a Domain called, User.

  • The Domain will contain the following Attributes, with each associated with the following Generators:
    • id  - RangeGen
    • employeeCode - ListCSVIndexGen
    • firstName - NameGen
    • lastName - NameGen
    • address - AddressGen
    • city - USStateCapitalGen
    • state - USStateGen
    • zipCode - USStateCapitalZipCodeGen


Attribute employeeCode - ListCSVIndexGen

The following provides a visual example of how the Generator configuration will appear for the employeeCode Attribute and is based on the given usage example. The employeeCode is the third column in CSV. Therefore its column index will be 2 because the index starts from zero.



Note: Please remember that the above image is based on the given example, and certain parameters may need to be different depending on your needs.