Parameterization

Neoload – Parameterization (variable)

Parameterization is a crucial step in NeoLoad after recording the user steps, conducting a check user path, and correlating dynamic values. It involves replacing hardcoded values, such as application URLs, usernames, passwords, or any other input data, with parameters that can have different input values. Parameterization allows for more realistic and diverse user behavior during load testing. It is important to understand parameterization as a beginner while ensuring originality and avoiding plagiarism. Here’s an explanation:

For Beginners:

Parameterization refers to the process of replacing fixed or hardcoded values in a load-testing script with parameters. These parameters can be assigned different values, enabling the simulation of various user inputs during the load test. By parameterizing user inputs, you can mimic real-world scenarios where users interact with the application using different data.

Example:

 You recorded an application’s login page by entering USER1 and PASS1 as the user and password. The same credentials are given when the script is run again. Now, you need to replace the hardcoded value, USER1, with a parameter (let’s say userName), if you wish to run a test with 5 different users (USER2, USER3, USER4, USER5, and USER6). This argument will include a list of all the User Name-related values and pass them when the test is run.

As a result, a parameter is used in the script to pass various input values.

How does NeoLoad handle parameterization?

The NeoLoad tool is used to capture a login-logout flow in order to simplify the parameterization approach. The Login page is one of 4 transactions in the script. The ‘Username’ and ‘Password’ parameter values are passed together with the request on the Login page. Refer to the example below

NeoLoad - Parameterization (Variable) - Recorded Flow                                                                                                figure:01

In order for virtual users to log in using alternative credentials, it is now intended to parameterize the value passing as “username” and “password.” The steps listed below must be followed for that purpose:

  1. Under the parameter tab, select the row. In the script, this tab can read “Post parameters” or “Request parameters.”
NeoLoad - Parameterization (Variable) - User Name

                                                                  figure:02

2. Click double on the chosen row.

3. The message “Request parameter” pops up

NeoLoad - Parameterization (Variable) - Request Parameter

figure:03

4. Select the ‘Value’ tab.

5. You have two choices here:

  • Use the phrase: This option is typically used for parameterization, where input values are given from an external source or predefined list.
  • Use an extra value: For correlation purposes, this option is used.

6.’Use an expression’ (the default option) should be used.

NeoLoad - Parameterization (Variable) - Use an expression

figure:04

7. You may see the original (recorded) value in the ‘Expression’ box.

8. The three-dot box adjacent to the “Expression” field should be clicked.

9. A pop-up for “Variable picker” appears

NeoLoad - Parameterization (Variable) - variable picker

figure:05

10. If you already have a defined variable, select it from the list; otherwise, select “Variables Manager”.

11.Pop-up “Variables” appears.

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_07.png

figure:06

12. The menu also has an option called “Variables,” as may be seen in the figure below.

NeoLoad - Parameterization (Variable) - NeoLoad Menu

figure:07

13. Choose “New variable.”

14. There is a list of variable types in a pop-up window.

NeoLoad - Parameterization (Variable) - Create variable

figure:08

15. As interdependent variables, username and password must be given as a pair. Therefore, the appropriate variable types are “List” and “File.” We’ll see both varieties of variables and understand how they work.

Type of ‘List’ Variable:

This is a straightforward form of variable, where all you need to specify is the variable’s name, the name of the column it belongs in, and a list of values. Using the ‘Add Column’ button and specifying the column’s name, you may add columns for the interdependent variables. We’ll see how.

  • ‘List’ should be chosen.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_10.png

figure:09

  • Type the variable’s name, such as the user credential.
  • Additionally, you can describe the variable. This is not required.
  • Use the ‘Add Column’ button to add a column.
  • Change the column’s names to “Username” and “Password.”
  • Add the corresponding variable’s value. To add more rows, click the ‘Add Value’ button.
NeoLoad - Parameterization (Variable) - List Type Variable

figure:10

  • ‘Apply’ should be clicked.
  • ‘OK’ should be clicked.
  • Choose the right variable name from the available list.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_13.png

figure:11

  • ‘OK’ should be clicked.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_14.png

figure:12

  • ‘OK’ should be clicked.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_15.png

figure:13

Type of ‘File’ Variable:

The ‘File’ type variable’s fundamental idea is comparable to that of LoadRunner. The ‘File’ variable type is the most appropriate to meet your needs if you already have a test data file with credentials available and separated by a separator like a comma, semicolon, space, tab, etc. Implementing it:

  • ‘File’ should be chosen.
NeoLoad - Parameterization (Variable) - File Type Variable

figure:01

  • Type the variable’s name, such as the user credential.
  • Additionally, you can describe the variable. This is not required.
  • By selecting the box next to the ‘File Name field, you can browse the test data file.
  • Fill out the ‘Column separator’ field with the appropriate separator. It is a semi-colon (;) by default.
  • To display the file data in the correct format, click the “Refresh” button.
  • The ‘Starting from line’ field should be filled up with the proper value.
  • Check the box next to “Use the first line in the file as the column heading?” if the first row in the test data file serves as the column header.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_20.png

figure:02

  • Click ‘Apply’.
  • Click ‘OK’.
  • Choose the correct variable name from the available list.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_13-1.png

figure:03

  • Click ‘OK’.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_14.png

figure:04

  • Click ‘OK’.
https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_15.png

figure:05

16. Now that the variable is defined, parameterizing the ‘password’ value becomes easy. When you create a variable using the “Variables” option (from the menu) and replace the value with that parameter, the “password” is parameterized in the same way. Let’s see the next steps.

17. Go to the ‘password’ row.

18. Double-click the selected row.

19. The message “Request parameter” appears

20. Select the ‘Value’ tab.

21. ‘Use an expression’ must be used (the default option).

22. You can see the original (recorded) value in the ‘Expression’ box.

23. You can see the original (included) value in the ‘Expression’ box.

24. A pop-up for “Variable Selector” will appear.

25. A suitable variable should be chosen, such as userCredential.passWord.

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_16.png

figure:06

26. Click ‘OK

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_18.png

figure:07

27. Run the “Check User Path” command to make sure the value gets to the variables. You can check the input of variables in the ‘Variables’ tab (Figure B) or in the corresponding prompt (Figure A).

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_21.png

figure:07

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_22.png

Image A

https://www.perfmatrix.com/wp-content/uploads/2021/06/NeoLoad_Parameterization_22.png

Image B

Conclusion:

    Parameterization is a critical step in NeoLoad after capturing user steps, performing a user path check, and mapping dynamic values. It involves replacing hardcoded values with parameters to allow for different user input during load tests. If you are a beginner, it is essential to understand parameterization while maintaining originality and avoiding plagiarism. Here are some important points to remember:

  • Parameterization Definition – Parameterization is the process of replacing hard-coded or fixed values in a load test script with parameters that can have different input values. Allows simulation of various user behaviors during load testing.
  • Beginner Approach: As a beginner, it is important to rely on your own understanding and knowledge to define variables and parameterization logic. Avoid directly copying parameterization logic or code from external sources to preserve originality.
  • Identify hardcoded values – Review the script and identify hardcoded values to replace with parameters. They can be URLs, usernames, passwords, form data, or other input values that vary between users or iterations.
  • Define and assign parameters: Create variables or parameters within the NeoLoad script to represent the values to be parameterized. Assign different input values to these parameters to simulate different user inputs during load testing.
  • Replace Hardcoded Values: Replace the hardcoded values in the script with the defined parameters. This ensures that the load test accurately represents real-world scenarios with different user inputs.
Scroll to Top