Seeding CSV Data into a Multi-Maestro Composition

Document created by Chris Sommerstad Employee on Jul 22, 2017Last modified by Sheril Joseph on Aug 14, 2017
Version 2Show Document
  • View in full screen mode

Seed data is used to dynamically populate certain values in a test, either via a comma-separated value (CSV) file, or by creation of a new seed data object in CloudTest.

CloudTest includes the ability to create repository-level seed data objects via the Central > Seed Data. Seed data can also be placed into a file (reachable by CloudTest) and referred to by URL.

In either case, seed data can then be utilized defining a Custom Property whose Value Type is either Seed Data: Repository or Seed Data: URL. This can be done at the Target, Clip, and Container levels of a test.

To create either seed data type, click Central > Seed Data and then New. The Seed Data Wizard can import data from a CSV, create a seed data object to enter new seed data manually, or reference CSV data in a network file. See Creating and Editing Seed Data for more about these options.

Seed data support includes the following capabilities:

    • Ability to access multiple columns (in either the CSV file or repository object).

For example, when utilizing username/password pairs, or lists of responses in a questionnaire.

    • Ability to allocate multiple rows per track repeat.

For example, so that repeating test clips within each track can each have their own row.

  • Ability to control how many rows are in the “slices” sent to each server.

 

The following notes and restrictions apply:

  • The CSV file used (for example, File.csv) must be in a location accessible by URL when the composition plays.
  • By default, only the first column of the CSV file is extracted, resulting in a single value for each Custom Property. Leading white space and trailing white space are trimmed from the values. See the “Advanced Procedures” section below to learn how to access values from multiple columns.
  • No security (such as Basic Authentication or other user ID or passwords) is provided when accessing the data via Seed Data: URL.
  • Because tracks can repeat based upon a runtime computation, such as repeat-while, repeat-for-each, or repeat counts set by script, CloudTest doesn’t compute slices based upon the track repeat count. Instead, values are distributed evenly to each server. So, if there are 5 Maestros playing the Composition, then 1/5 of the data is distributed to each one. If a track repeats more times than the slice size, then it will wrap back to the start of the slice of data. It is up to the user to ensure that the size of the seed data is sufficient to prevent this from.

 

  • To prevent too much data from being sent around unnecessarily, the default slice size per server is 2,000 rows. This maximum can be changed via the Maestro service setting SeedData.MaxServerSliceSize, which can be found in the Central > Servers > Settings tab whenever the Maestro service is selected for a given server.

Basic Example (One Column Seed Data File)

By default, only the first column of the CSV file is extracted, resulting in a single value for each Custom Property. The most basic seed data example pulls an individual value from a CSV file with one column (and a sufficient number of rows to populate all the possible values).

The steps to customize the test include the creation of:

  • One track custom property—the file location.
  • Replacement of the dynamic string value with the property path (or ISSE). For example, all occurrences of a username can be dynamically substituted from File.csv using {%% prop : track : seedData_File %%}.

For more about substituting property paths, refer to Setting Property Paths.

 

Create a Custom Track Property That Points to the Seed Data File

Since the clip’s property path is based on the track custom property, it is created first. Use the following steps:

  1. Open the test composition.
  2. Click the Properties tab in the lower panel and then select the track from the Properties list.
  3. Click the Custom Properties tab.
  4. Click the green plus to create a custom property at the track level whose name starts with seedData (case sensitive) and ends with the file name. For example: seedData_File.

  1. Set the custom property's value type to Seed Data: URL and its URLto be the URL of the file that contains the seed data.
  2. Save the composition.

When the composition is played, the data in the CSV file will be extracted and set as the value of the custom property in the track. If the track repeats, each repeat of the track will get a different value.

 

Substitute the Dynamic Value into the Test Clip

The Custom track Property can be referred to using a property path, ISSE, script, or anywhere else a Custom Property can be used. There can be multiple seed data properties in a single track, each with a different URL or using the same URL. Parameterization of test clips to deploy seed data can be performed manually, using Find and Replace, or using the Session Template Wizard.

 

  1. Open the clip in the Clip Editor and then locate and open the message to edit by double-clicking.
  2. Select the text value to be replaced.
  3. With the text selected, click the Property Chooser icon.
  4. In the Property Chooser dialog box, check “The property is not local to this message. It is specified here:”
  5. In the Type drop-down, select Custom.
  6. In the Starting Element drop-down, select Current Track.
  7. Enter the name of the custom property that calls the seed data file. For example, a custom property namedct seedData_File.

The selected text from above is replaced as shown on the right.

Note: If there is more than one, or the number is unknown, consider using Find and Replace or the Session Template Wizard’s Variable Search and Retrieval method.

Advanced Settings

Advanced Options are specified to control seed data behavior in certain situations. Define custom properties with the following Advanced options:

  • Column Count
  • Row Count
  • Maximum Rows Per Server

For a detailed discussion of these parameters, see Setting Advanced Seed Data Options (in Tracks, Clips, and Containers).

Intermediate Example

The composition shown below includes a track that uses a Dedicated Load Server. The track’s Copy Count is 4, which will result in the track being copied to four servers. The track’s virtual users (parallel repeats) is set to 25. Since the test clip has no additional repeats set the estimated Total Virtual Users calculation shows that the composition has 100 estimated virtual users.

The seed data file for this composition must have, minimally, 100 rows, if each user is to receive unique data.

The composition’s lower panel General properties also reflect these settings.

The track’s custom properties (shown by clicking the Custom Properties tab when the track is selected) also reflect the 100 virtual user count.

Note that the column count (shown right) is five. When the property path is substituted, the array values are deployed similarly to the values shown here: seedData_100[0], seedData_100[1], seedData_100[2], seedData_100[3], and seedData_100[4]. This array reflects the value of the columnCount parameter shown above.

Advanced Example

This example uses the following CSV file, which is assumed to be located at “http://hostname/SampleSeedData4.csv”:

The Composition contains a Track, named Track 1 with 3 Virtual Users that are copied to 3 servers using Dedicated Load Server and the activated Copy Count field.

The track contains the following Custom Property:


Custom Property name

Value

seedDataSample4

http://hostname/SampleSeedData4.csv

Column Count

3

Row Count

4

When the Composition plays, the following instances of the Track are given the following values for the Custom Property seedDataSample4:

 

Track: "Track 1 (server 1 of 3)" [0]

Track: "Track 1 (server 1 of 3)" [1]

;

Track: "Track 1 (server 1 of 3)" [2]

Track: "Track 1 (server 2 of 3)" [0]

Track: "Track 1 (server 2 of 3)" [1]

Track: "Track 1 (server 2 of 3)" [2]

Track: "Track 1 (server 3 of 3)" [0]

Track: "Track 1 (server 3 of 3)" [1]

Track: "Track 1 (server 3 of 3)" [2]

Attachments

    Outcomes