Parameterization

Parameterization replaces hardcoded input data (like search queries and log-in credentials) with dynamic parameter inputs. This prevents the application server from caching database responses.

Note: Which values you enter through keyboard those values should be parameterized. Your script should not contain any hand coded values.

Parameter Types

1. File

Pull data rows from a DAT, CSV, or XML table.

2. Date & Time

Generate current, future, or prior dates with custom offsets.

123

3. Iteration Number

Use the current iteration number in the script.

4. Random Number

Generate random numbers within specified range.

5. Unique Number

Generate unique numbers during script execution.

6. VUserID

Assign values based on virtual client (VUser) IDs.

7. Group Name

Use group / scenario / executor names as parameter values.

8. Load Generator Name

Use the name of the load generator / machine running the script.

9. Table

Read data from table within the test data file.

10. XML

Read data from XML file using XPath expressions.

11. User Defined

Create and use custom parameters as per business needs.

Select Next Row & Update Value Combinations

Property Sequential Random Unique
Each Iteration Users pick row 1 on iteration 1, row 2 on iteration 2, etc. Users pick a random row on every iteration. Each user gets a dedicated, unused segment of rows, updating every iteration.
Each Occurrence Row updates every time the parameter is referenced in the script. A new random row is chosen on every reference. Row updates to the next unused row on every reference.
Once Row is selected once on startup, and kept for all iterations. A random row is selected on startup, and kept. An unused row is allocated on startup, and kept throughout the run.

Parameterization in Tools

Steps may vary slightly based on tool versions. The core concept remains the same.

1. LoadRunner (VuGen) – Parameterization

1

Add Parameter

In VuGen, go to Data → Parameter List and create a new parameter.

2

Choose Type

Select parameter type (File, Date/Time, Random, Table, etc.).

3

Configure Data

Provide file path or value settings as per parameter type.

4

Use in Script

Replace hardcoded values with parameter name.

5

Save & Verify

Save parameter and run the script to verify data is picked.

LoadRunner – Parameterization Examples

Example 1: Web – Reg (File Parameter)

Parameter Name Type File Name Select Next Row Update Value Usage In Script Sample Data (CSV)
p_user File users.csv Sequential Each Iteration web_submit_data(..., "username={p_user}", ...) username,password
user1,pass1
user2,pass2
user3,pass3

Example 2: Random Number (LB/RB)

Parameter Name Type Min Value Max Value Step Usage In Script Example
p_LB Random Number 1000 9999 1 web_reg_save_param("LB={p_LB}") LB=4521
p_RB Random Number 1000 9999 1 web_reg_save_param("RB={p_RB}") RB=8734
p_ORD Random Number 100000 999999 1 web_reg_save_param("ORD={p_ORD}") ORD=540932

Example 3: Date & Time Parameter

Parameter Name Type Date Format Offset Usage In Script Example Value
p_currDate Date & Time yyyy-MM-dd 0 (Current Date) web_submit_data(..., "date={p_currDate}", ...) 2025-05-20

Dependent Parameters

A dependent parameter uses the value of another parameter.

Example:

  • Parameter p_state depends on p_country.
  • First extract p_country, then use it to fetch p_state values.

How to Handle:

  1. Correlate parent parameter first.
  2. Use the parent parameter in child parameter's file / query.

Best Practices

  • Avoid hardcoded values in scripts.
  • Use the appropriate parameter type for the data.
  • Keep test data files clean and well-structured.
  • Validate parameter values before runtime.
  • Re-use parameter files across scenarios when possible.
  • Keep sensitive data (passwords, tokens) in external files or vault.