This section discusses setting the properties for data that is generated internally by the Vuser. Internal data includes data such as:
➤ Date/Time
➤ Group Name
➤ Iteration Number
➤ Load Generator Name
➤ Random Number
➤ Unique Number
➤ Vuser ID
Date/Time
Date/Time replaces the parameter with the current date and/or time. To specify a date/time format, you can select a format from the format list or specify your own format. The format should correspond to the date/time format recorded in your script.
VuGen lets you set an offset for the date/time parameter. For example, if you want to test a date next month, you set the date offset to 30 days. If you want to test your application for a future time, you specify a time offset. You can specify a forward, future offset (default) or a backward offset, a date or time that already passed. In addition, you can instruct VuGen to use date values for work days only, excluding Saturdays and Sundays.
The following table describes the date/time symbols:
To set the properties for Date/Time parameters:
1 Select one of the existing date/time formats or create a new format. You can view a sample of how VuGen will display the value, in the Sample (Current time) box. For information on customizing parameter formats, see
“Customizing Parameter Formats” on page 135.
2 To set a date and time offsets, select Offset Parameter by and specify the desired offset for the date and time values.
To instruct VuGen to use working day dates only, excluding weekends, select Working days only. To indicate a negative offset to test a date prior to the current, select Prior to current date.
3 Select an update method, instructing the Vuser when to update parameter values—Each occurrence, Each iteration, or Once. For more information, see
“Selecting an Update Method” on page 136.
4 Click Close to accept the settings and close the Parameter Properties dialog box.
Symbol Description
c complete date and time in digits
#c complete date as a string and time
H hours (24 hour clock)
I hours (12 hour clock)
M minutes
S seconds
p AM or PM
d day
m month in digits (01-12)
b month as a string - short format (e.g. Dec) B month as a string - long format (e.g. December) y year in short format (e.g. 03)
Y year in long format (e.g. 2003)
Group Name
Group Name replaces the parameter with the name of the Vuser Group. You specify the name of the Vuser Group when you create a scenario or session step. When you run a script from VuGen, the Group name is always None.
To set properties for the Group Name parameter type:
1 Select one of the available formats or create a new one. You select a format to specify the length of the parameter string. For details, see “Customizing Parameter Formats” on page 135.
2 Click Close to accept the settings and close the Parameter Properties dialog box.
Iteration Number
Iteration Number replaces the parameter with the current iteration number.
To set the properties for the Iteration Number parameter type:
1 Select one of the available formats or create a new one. You select a format to specify the length of the parameter string. For details, see “Customizing Parameter Formats” on page 135.
2 Click Close to save the settings and close the Parameter Properties dialog box.
Load Generator Name
Load Generator Name replaces the parameter with the name of the Vuser script’s load generator. The load generator is the computer on which the Vuser is running.
To set the properties for the Load Generator Name parameter type:
1 Select one of the available formats or create a new one. You select a format to specify the length of the parameter string. For details, see “Customizing Parameter Formats” on page 135.
2 Click Close to save the settings and close the Parameter Properties dialog box.
Random Number
Random Number replaces the parameter with a random number. You set a range of numbers by specifying minimum and maximum values.
You can use the Random Number parameter type to sample your system’s behavior within a possible range of values. For example, to run a query for 50 employees, where employee ID numbers range from 1 through 1000, create 50 Vusers and set the minimum to 1 and maximum to 1000. Each Vuser receives a random number, from within the range of 1 to 1000.
To set the properties for the Random Number parameter type:
1 Enter a range defining the set of possible parameter values. You specify minimum and maximum values for the range of random numbers.
2 Select a Number format, indicating the length of the random number.
Specify %01lu (or %lu) for one digit, %02lu for two digits, and so on. You can view a sample of how VuGen will display the value, in the Sample value box.
3 Select an update method, instructing the Vuser when to update parameter values—Each occurrence, Each iteration, or Once. For more information, see
“Selecting an Update Method” on page 136.
4 Click Close to accept the settings and close the Parameter Properties dialog box.
Unique Number
Unique Number replaces the parameter with a unique number.
When you create a Unique Number type parameter, you specify a start number and a block size. The block size indicates the size of the block of numbers assigned to each Vuser. Each Vuser begins at the bottom of its range and increments the parameter value for each iteration. For example, if you set the Start number at 1 with a block of 500, the first Vuser uses the value 1 and the next Vuser uses the value 501, in their first iterations.
The number of digits in the unique number string together with the block size determine the number of iterations and Vusers. For example, if you are limited to five digits using a block size of 500, only 100,000 numbers (0-99,999) are available. It is therefore possible to run only 200 Vusers, with each Vuser running 500 iterations.
You can also indicate what action to take when there are no more unique numbers in the block: Abort Vuser, Continue in a cyclic manner, or Continue with last value (default).
You can use the Unique Number parameter type to check your system’s behavior for all possible values of the parameter. For example, to perform a query for all employees, whose ID numbers range from 100 through 199, create 100 Vusers and set the start number to 100 and block size to 100.
Each Vuser receives a unique number, beginning with 100 and ending with 199.
Note: VuGen creates only one instance of Unique Number type parameters.
If you define multiple parameters and assign them the Unique Number Parameter type, the values will not overlap. For example, if you define two parameters with blocks of 100 for 5 iterations, the Vusers in the first group use 1, 101, 201, 301, and 401. The Vusers in the second group use 501, 601, 701, 801, and 901.
To set the properties for the Unique Number parameter type:
1 Enter a start number and the desired block size. For example, if you want 500 numbers beginning with 1, specify 1 in the Start box, and 500 in the Block size per Vuser box.
2 Select a Number format, indicating the length of the unique number.
Specify %01d (or %d) for one digit, %02d for two digits, and so on. You can view a sample of how VuGen will display the value, in the Sample value box.
3 Select an update method, instructing the Vuser when to update parameter values—Each occurrence, Each iteration, or Once. For more information, see
“Selecting an Update Method” on page 136.
4 Indicate what to do when there are no more unique values, in the When out of values box: Abort Vuser, Continue in cyclic manner, or Continue with last value.
Note: (For LoadRunner users!)
When scheduling a scenario in the Controller, the When out of values option only applies to the Run for HH:MM:SS option in the Schedule Builder’s Duration tab. It is ignored for the Run until completion option.
5 Click Close to accept the settings and close the Parameter Properties dialog box.
Vuser ID
Note: This parameter type applies primarily to LoadRunner users.
Vuser ID replaces the parameter with the ID number assigned to the Vuser by the Controller during a scenario run, or the Console during a session step run. When you run a script from VuGen, the Vuser ID is always -1.
Note: This is not the ID number that appears in the Vuser window—it is a unique ID number generated at runtime.
To set the properties for the Vuser ID parameter type:
1 Select one of the available formats or create a new one. You select a format to specify the length and structure of the parameter string. For details, see
“Customizing Parameter Formats” on page 135.
2 Click Close to accept the settings and close the Parameter Properties dialog box.