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:
-
- Right click on the value that you want to do parameterization.
- Click on replace with parameter.
- Create new parameter
- Give the parameter Name as shown in the image
- Click on OK
- It will ask “Do you want to replace all occurrences of the string with parameter?” Click on Yes
- Now click on parameters as shown in the image or Press CTRL+L
- You will see the parameter value that is created.
Types of parameters in Loadrunner with Examples
Following are the different types of Parameters in Loadrunner
- Custom
- Date/Time
- File
- Group Name
- Iteration Number
- Load Generator Name
- Random Number
- Table
- Unique Number
- User Defined Function
- Vuser ID
- 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.
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
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