8/14/2019 Load Runner Parameters Chapter 7
1/16
Krish Hegde 1
Parameters
When you record a business process,VuGen generates a script that containsthe actual values used during recording.
Suppose you want to perform the scriptsactions (query, submit, etc.) using differentvalues from those recorded.
To do this, you replace the recordedvalues with parameters. This is known asparameterizingthe script.
8/14/2019 Load Runner Parameters Chapter 7
2/16
Krish Hegde 2
Parameters
Advantages with Parameterizing:
2. It reduces the size of the script.
3. It provides the ability to input uniquevalues.
8/14/2019 Load Runner Parameters Chapter 7
3/16
Krish Hegde 3
Parameterize Functions
Parameterization involves the following two
tasks:
2. Replacing the constant values in theVuser script with parameters
3. Setting the properties and data source
for the parameters
8/14/2019 Load Runner Parameters Chapter 7
4/16
Krish Hegde 4
Parameterize Functions
To create a parameter:
1 Right-click on the string to parameterize. Theright-click pop-up menu opens.
2 From the pop-up menu, select Replace with aParameter. The Select or
Create Parameterdialog box opens.
3. Type a name for the parameter in theParameter name box, or select an existing
parameter name from the list.4. Select a parameter type from the Parameter
type list.
5. Click OK.
8/14/2019 Load Runner Parameters Chapter 7
5/16
Krish Hegde 5
Parameter Properties
After you create a parameter, you define itsproperties. A parameters properties define thedata source the parameter uses during scriptexecution. To define parameter properties:
Right-click on the parameter. The right-clickpop-up menu opens.
From the pop-up menu, select Parameter
Properties. Enter the properties of the parameter.
Click Close.
8/14/2019 Load Runner Parameters Chapter 7
6/16
Krish Hegde 6
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.
8/14/2019 Load Runner Parameters Chapter 7
7/16
Krish Hegde 7
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 replacesthe parameter with the values from the data file.
You can create a file using VuGen or you can use an existingfile. 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 themenu list or specify your own format.
You should select the format of the date and time as it appearsin your script.
8/14/2019 Load Runner Parameters Chapter 7
8/16
Krish Hegde 8
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.
8/14/2019 Load Runner Parameters Chapter 7
9/16
Krish Hegde 9
Parameter Source
When you define a parameters properties,you specify the source for the parameterdata. 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 fileeither an existing file or one that youcreate with VuGen.
8/14/2019 Load Runner Parameters Chapter 7
10/16
Krish Hegde 10
Data Files
Data Files Data files hold data that a Vuser accesses
during script execution. Data can be stored inlocal 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 knownvalues for your parameter.
The data in a data file is stored in the form of a
table. One file can contain values for manyparameters. Each column holds the data for oneparameter. Column breaks are marked by adelimiter, for example, a comma.
8/14/2019 Load Runner Parameters Chapter 7
11/16
Krish Hegde 11
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 delimiter5. an update method
8/14/2019 Load Runner Parameters Chapter 7
12/16
Krish Hegde 12
Data Files
8/14/2019 Load Runner Parameters Chapter 7
13/16
Krish Hegde 13
Data Files
Type a name for the data file in the File pathbox, or click Browse to specify the file locationof an existing data file.
Click Edit. Notepad opens with the parametersname in the first row and original value in thesecond row. Enter additional column names andvalues into the file in the form of a table.
To add a column to the data file withoutlaunching Notepad, click Add Col in theParameter Properties dialog box.
8/14/2019 Load Runner Parameters Chapter 7
14/16
8/14/2019 Load Runner Parameters Chapter 7
15/16
Krish Hegde 15
Verifying Correct execution
After replacing the value with the
parameter run the script and check
whether it successfully works.
8/14/2019 Load Runner Parameters Chapter 7
16/16
Krish Hegde 16
Questions?
Recommended