Parameterization

Parameterize LoadRunner

Scripting enhancement comes after learning the basics of recording and debugging scripts in LoadRunner. In LoadRunner, augmenting scripts means adding some extra capabilities to make scripting simpler, more complete, and more regressive. “Parameterization” is the first stage within the script enhancement section.

For Beginners: If you’re just starting out, you need to understand what parameterization is. The parameterization process involves replacing an input parameter with an encoded value, such as an application URL, username, or password.

Example:

An application’s login page is captured with the credentials USER1 and PASS1. The same credentials are given when the script is run again. You must now replace the hardcoded number, USER1, with a parameter (such as p_userID), if you want to run a test with 5 different users (USER2, USER3, USER4, USER5, and USER6). When the test runs, this argument takes and passes a list of all the specified values.

As a result, the script uses one parameter to pass different input values.

How do you parameterize LoadRunner?

In LoadRunner, parameterization can be done in two different ways:

a) If there is no list of specified parameters:

  1. The script, please.
  2. Choose the text value (or value) that you want to parameterize.
  3. Right-click on the text you chose.
  4. Choose “Replace by Parameter” from the menu.
  5. Simply select “Create new parameter”
https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Create_New.png

Figure 01: The step is indicated by a number

6. The ‘Select or Create Parameter’ pop-up will appear; enter a value for the ‘Parameter Name’ and ‘Parameter Type’ fields, then click the ‘OK’ button.

https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Select_Popup.png

    Figure 2: ‘Select or create parameter’ pop-up window

7. You will see another popup asking if you want to replace each instance of the string with the argument. Select ‘Yes’ to replace each instance of the text. This will cause the parameter name to replace the parameterized value.

https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Replace_All.png

Figure 3:

8. Select the appropriate option after setting the replacement parameters. The “Find Next” option locates the next occurrence of the text. The “Replace” option only replaces the highlighted text, but the “Replace All” option replaces any occurrence of the text that falls within the chosen range.

https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Confirm.png

Figure 04 – Substitution Scope

b) Visit the script when you have a list of

  1. Predefined parameters.
  2. Choose the text value (or value) that you want to parameterize.
  3. Right-click on the text you chose.
  4. Choose “Replace by Parameter” from the menu.
  5. Select the appropriate parameter from the list under “Parameter list…”.
https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Existing_Parameter.png

Image 05

6. “Do you want to replace all occurrences of the string with the parameter?” asks a popup window. Select ‘Yes’ to replace each instance of the text. This will cause the parameter name to replace the parameterized value.

LoadRunner Parameterization

Image 06

7. Select the appropriate option after setting the replacement parameters. The “Find Next” option locates the next occurrence of the text. The “Replace” option only replaces the highlighted text, but the “Replace All” option replaces any occurrence of the text that falls within the chosen range.

LoadRunner Parameterization

Image 07

How to reset the parameter in LoadRunner to its original value?

  1. Right-click on the parameter you want to restore.
  2. Restore the original value by clicking.
https://www.perfmatrix.com/wp-content/uploads/2020/01/LoadRunner_Parametrization_Restore.png

Image 08

Scroll to Top