- Subscribe to RSS Feed
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content
Seeding CSV Data into a Multi-Maes tro Compositio n
|
Seed data support includes the following capabilities:
|
|||||||||
The following notes and restrictions apply:
|
|||||||||
|
|||||||||
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:
For more about substituting property paths, refer to Setting Property Paths. For more about substituting ISSEs, refer to In Situ Substitution Expressions. |
|||||||||
Create a Custom Track Property That Points to the Seed Data FileSince the clip’s property path is based on the track custom property, it is created first. Use the following steps:
|
|||||||||
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 ClipThe 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. |
|||||||||
|
|
||||||||
|
The selected text from above is replaces 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. |
|||||||||
ParametersThere are some optional parameters that can be specified to control seed data behavior in certain situations. Defining additional custom properties with the name of the main Custom Property followed with
For example, if there was a Custom Property named ParametersAll parameters are numeric values that must be greater than zero. |
|||||||||
|
The columnCount parameter specifies the number of columns to retrieve from the CSV file. If the value is one, the property is set to a single value. If this parameter is not present, the value 1 is used. If the value is greater than one, the property is set to an array value. If there are fewer columns in the CSV file than specified by columnCount, then the extra values in the array are set to null. The array will always be the size specified by columnCount. A simple example of the use of multiple columns would be where the CSV file contains username and password pairs. In this case the CSV file might contain two columns, the first column being the username and the second being the corresponding password. Each track instance needs access to both values, so columnCount is set to 2. The Custom Property value assigned to each track instance will be an array with the two values. |
|||||||||
|
The rowsPerTrack parameter specifies the number of rows from the CSV file to distribute to each instance of each track. If the value is greater than one, then the property will be an array value, one entry in the array for each row. If this parameter is not present, the value one is used. Note that if both columnCount and rowsPerTrack are greater than one, then the property value will be a two-dimensional array, where the first index is the row and the second index is the column. The rowsPerTrack controls how many rows are allocated for each instance (repeat) of that Track. For example, if theclip repeats 3 times, then the value of rowsPerTrack will be (minimally) 3, since you want each instance (repeat) of that track to get 3 rows. One example of the use of multiple rows per track would be where the track contains a serially repeatingclip and it is desired to have each repeat of theclip use a different value. The rowsPerTrack is set to a big enough value to cover the expected number of serial repeats of the Clip. Somewhere inside the Clip, a Script or ISSE would typically access the Custom Property’s array value by using theclip Repeat Index (or some other appropriate mathematical formula) as the index into the array. This logic should ideally check for, and handle, running out of values (typically by either generating an error or by wrapping back to the first value in the array). |
|
||||||||
|
The maxRowsPerServer parameter specifies the maximum “slice size” (number of rows out of the total number of rows) to distribute to each server of a Composition that plays on multiple servers. As noted above, CloudTest doesn’t compute slices based upon the track repeat count due to runtime computations such as repeat-for-each or repeat-while. If this parameter is not present, the value of the SeedData.MaxServerSliceSize Server Setting will be used (or 2,000 if there is no such setting present). This parameter is useful if the default value of 2,000 is not appropriate. Some typical examples:
|
|||||||||
Intermediate ExampleThe 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: |
|||||||||
Advanced ExampleThis 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 Properties:
|
|||||||||
|
The custom track properties look like this: |
|||||||||
|
When the Composition plays, the following instances of the Track are given the following values for the Custom Property |
|
||||||||
|
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] |
|























