LoadRunner Parameterization

LoadRunner Parameterization

After covering the basics of script recording and debugging in LoadRunner, the next step is script enhancement. Script enhancement in LoadRunner implies to add some additional functionalities to make the script simple, comprehensive and regressive. The first step under script enhancement part is ‘Parameterization’.

For Beginners: If you are a beginner then you must know what is parameterization? Parameterization is a method to replace the hardcoded value like application URL, User Name, Password etc. with a parameter which has different input values.
Example: You recorded a login page of an application by providing the credentials USER1 and PASS1. When you replay the script, the same credentials are passed. Now, if you want to run a test with 5 different users (USER2, USER3, USER4, USER5 and USER6) then you need to replace the hardcoded value i.e. USER1 with a parameter (say p_userID). This parameter will have a list of all the given values and pass them at the time of the test execution.

Hence a parameter is used to pass different input values in the script.

How to do parameterization in LoadRunner?

There are 2 methods to do parameterization in LoadRunner:

a) When you do not have a predefined parameter list:

  1. Go to the script.
  2. Select the value (text) which you want to parameterize.
  3. Right-click on the selected text.
  4. Click ‘Replace with Parameter’ option.
  5. Click ‘Create New Parameter…’
Figure 01: Number denotes the step
  1. ‘Select or Create Parameter’ pop-up will open then provide the value for ‘Parameter name’ and ‘Parameter type’ field and click ‘Ok’ button.
Figure 02: ‘Select or Create Parameter’ pop-up
  1. Another pop-up will appear stating ‘Do you want to replace all occurrences of the string with parameter?’. Click ‘Yes’ to replace all the occurrences of the text. This will replace the parameterized value with the parameter name.
Figure 03
  1. Set the scope of the replacement and click on the suitable option. ‘Find Next’ option identifies the next occurrence of the text. ‘Replace’ option replaces the highlighted text only whereas ‘Replace All’ option replaces all the occurrences of the text as per the selected scope.
Figure 04: Scope of replacement

b) When you have a predefined parameter list:

  1. Go to the script.
  2. Select the value (text) which you want to parameterize.
  3. Right-click on the selected text.
  4. Click ‘Replace with Parameter’ option.
  5. Choose an appropriate parameter suggested below the ‘Parameter List…’.
Figure 05
  1. A pop-up appears stating ‘Do you want to replace all occurrences of the string with parameter?’. Click ‘Yes’ to replace all the occurrences of the text. This will replace the parameterized value with the parameter name.
LoadRunner Parameterization
Figure 06
  1. Set the scope of the replacement and click on the suitable option. ‘Find Next’ option identifies the next occurrence of the text. ‘Replace’ option replaces the highlighted text only whereas ‘Replace All’ option replaces all the occurrences of the text as per the selected scope.
LoadRunner Parameterization
Figure 07

How to restore the original value of the parameter in LoadRunner?

  1. Right-click on the parameter which you want to be restored.
  2. Click ‘Restore original value’.
Figure 08: Restoring the original value

Leave a Reply

Your email address will not be published. Required fields are marked *