You are on page 1of 16

Parameters

• When you record a business process,


VuGen generates a script that contains
the actual values used during recording.
Suppose you want to perform the script’s
actions (query, submit, etc.) using different
values from those recorded.
• To do this, you replace the recorded
values with parameters. This is known as
parameterizing the script.

Krish Hegde 1
Parameters
Advantages with Parameterizing:
2. It reduces the size of the script.
3. It provides the ability to input unique
values.

Krish Hegde 2
Parameterize Functions
Parameterization involves the following two
tasks:
2. Replacing the constant values in the
Vuser script with parameters
3. Setting the properties and data source
for the parameters

Krish Hegde 3
Parameterize Functions
• To create a parameter:
1 Right-click on the string to parameterize. The
right-click pop-up menu opens.
2 From the pop-up menu, select Replace with a
Parameter. The Select or
• Create Parameter dialog box opens.
3. Type a name for the parameter in the
Parameter name box, or select an existing
parameter name from the list.
4. Select a parameter type from the Parameter
type list.
5. Click OK.
Krish Hegde 4
Parameter Properties
• After you create a parameter, you define its
properties. A parameter’s properties define the
data source the parameter uses during script
execution. To define parameter properties:
• Right-click on the parameter. The right-click
pop-up menu opens.
• From the pop-up menu, select Parameter
Properties.
• Enter the properties of the parameter.
• Click Close.
Krish Hegde 5
Parameters
• Different types of Parameters:
2. File
3. Date/time
4. User ID
5. Group Name
6. Iteration number
7. Load Generator name
8. Random Number parameter
9. Unique number
10. User Defined Function
11. User File path.
Krish Hegde 6
Parameters
• File type:
– A file contains the values for the parameter you define in your
Vuser script. When you run a Vuser script, the Vuser replaces
the parameter with the values from the data file.
– You can create a file using VuGen or you can use an existing
file. The file must have a .dat or .txt extension.
• 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
menu list or specify your own format.
– You should select the format of the date and time as it appears
in your script.

Krish Hegde 7
Parameters
• Vuser ID type Parameters:
– Replaces the parameter with the ID assigned
to the Vuser by the Controller during the
scenario run.
– When you run a script from VuGen, the Vuser
ID is always 1.

Krish Hegde 8
Parameter Source
• When you define a parameter’s properties,
you specify the source for the parameter
data. You can specify either of the
following data source types:
• Internal Data: Data that is generated
internally by the Vuser.
• Data Files: Data that is contained in a file
—either an existing file or one that you
create with VuGen.
Krish Hegde 9
Data Files
Data Files
• Data files hold data that a Vuser accesses
during script execution. Data can be stored in
local or global files. You can specify an existing
ASCII file or use VuGen to create a new one.
Data files are useful if you have many known
values for your parameter.
• The data in a data file is stored in the form of a
table. One file can contain values for many
parameters. Each column holds the data for one
parameter. Column breaks are marked by a
delimiter, for example, a comma.
Krish Hegde 10
Data Files
• When you use a file as the source of
data for a parameter, you must specify
the following:
2. the name and location of the file
3. the column containing the data
4. the file format, including column delimiter
5. an update method

Krish Hegde 11
Data Files

Krish Hegde 12
Data Files
• Type a name for the data file in the File path
box, or click Browse to specify the file location
of an existing data file.
• Click Edit. Notepad opens with the parameter’s
name in the first row and original value in the
second row. Enter additional column names and
values into the file in the form of a table.
• To add a column to the data file without
launching Notepad, click Add Col in the
Parameter Properties dialog box.

Krish Hegde 13
Updating Parameter Values from Files

• When using values from a file, VuGen


lets you specify the way in which you
assign values to the parameters. The
available methods are:
• Sequential
• Random
• Unique
• Same line as <parameter>
Krish Hegde 14
Verifying Correct execution
• After replacing the value with the
parameter run the script and check
whether it successfully works.

Krish Hegde 15
• Questions?

Krish Hegde 16