Description

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


Parameters

  • 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 index of the column from where the data has to be read. The index starts with 0. e.g. the third column will have index 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.
  • 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.
  • 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 a true Scenario, the data will be loaded from the specified resource.
  • startIndex - Defines the index in the list where to start from.
  • jumpAmount - Defines the amount to add to the index of generated value.


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 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 will need to create a Domain called, User.

  • The Domain will contain the following Attributes with each associated to 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.