Parameterization in Loadrunner Step by Step

In this Loadrunner tutorial, we will discuss how to do parameterization in Loadrunner. This is one of the important topics in Loadrunner.

What is Parameterization?

Parameterization is passing different values for each virtual user or iteration. When you record an application in Loadrunner, during recording the script contains values such as username, password, account number etc. Suppose if you want to pass different username, password and account numbers for each iteration that login into the application, then you can use parameterization.

How to do Parameterization in Loadrunner:

    1. Right click on the value that you want to do parameterization.
    2. Click on replace with parameter.
    3. Create new parameter

      Parameterization in Loadrunner 1
      Parameterization in Loadrunner 1
    4. Give the parameter Name as shown in the image
    5. Click on OK

      Parameterization in Loadrunner 2
      Parameterization in Loadrunner 2
    6. It will ask “Do you want to replace all occurrences of the string with parameter?” Click on Yes

      Parameterization in Loadrunner 3
      Parameterization in Loadrunner 3
    7. Now click on parameters as shown in the image or Press CTRL+L

      Parameterization in Loadrunner 4
      Parameterization in Loadrunner 4
    8. You will see the parameter value that is created.
Parameterization in Loadrunner 5
Parameterization in Loadrunner 5

Types of parameters in Loadrunner with Examples

Following are the different types of Parameters in Loadrunner

  1. Custom
  2. Date/Time
  3. File
  4. Group Name
  5. Iteration Number
  6. Load Generator Name
  7. Random Number
  8. Table
  9. Unique Number
  10. User Defined Function
  11. Vuser ID
  12. XML

1.Custom

Customer Parameter is used to store a single value that you want to pass and it will take that value. I don’t see much use of this parameter.

2.Date/Time

You will use this very frequently in your scripting as you need to pass different dates, like current date, future date, Unix Time Stamp etc.

You will come across this function in many of the regular scripting and you need to practice this option multiple times. Such as how to set the data forward by 10 days etc.

3.File

File Parameter is used to pass values like username and password and you can use rows and columns in the file.

4.Group Name

Group name is used to define the groups for the scripts

5.Iteration Number

Iteration Number is used to track iteration number and pass in the script when it is required and you can define the format like 0001 or 01 etc.

6.Load Generator Name

You can use this parameter to define the load generator name.

7.Random Number

Random number is one of the important parameter to pass random numbers in the scripts.

8.Table

Table is similar to file Type parameter, you can pass multiple values.

9.Unique Number

The title itself explains that this will help in passing the unique number in each iteration.

10.User Defined Function

Using this parameter you can use the function in your script and define the DLL path.

11.Vuser ID

Vuser ID is used to track the users in the test and print different logs and track the errors in the test.

12.XML

Using this parameter you can pass the xml and its respective values.

Parameterization in Loadrunner interview questions

You will be asked at least two to three questions during your interview. It’s always tricky to answer the questions in Parameterization.

Question:I have 10 Virtual users and each users run 2 iterations and I set Unique each iteration in the script, how the values are passed for each user.

Answer: See the screenshot below, the first user picks first two values and the second user picks third and fourth value and soon.

Unique Each Iteration

Question: I have 10 Virtual users and each users run 2 iterations and I set Sequential for each iteration in the script, how the values are passed for each user.

Answer: See the screenshot below, the first user picks the first value and second value and soon. All the users repeat the same.

Sequential Each Iteration

Sequential Each Iteration

Question:How do you pass date + one day in the script?

Question:How do you pass UNIX timestamp in the script?

Question:What is offset parameter by?

This will pretty much cover all the questions, practice all the parameters at least once before going to the interview. All the best!!

If you like this article, you can also go through all our  Loadrunner Tutorial