LoadRunner Tutorial for Beginners: Getting Started with HP/Micro Focus LoadRunner

LoadRunner Tutorial for Beginners: Getting Started with HP/Micro Focus LoadRunner

LoadRunner is the enterprise standard for performance testing. Originally developed by Mercury Interactive, it's been through HP and now Micro Focus (OpenText), accumulating 30+ years of refinement. It's expensive, complex, and still the tool most large organizations reach for when they need serious load testing.

This tutorial covers the fundamentals: what LoadRunner is, how its components work together, how to record and edit a script, and how to run your first load test.

What Is LoadRunner?

LoadRunner is a performance testing tool suite consisting of three main components:

  1. VuGen (Virtual User Generator) — records and edits test scripts
  2. Controller — designs and runs load test scenarios
  3. Analysis — analyzes performance results

The workflow is: record a user journey in VuGen → configure how many virtual users run it and how in Controller → analyze results in Analysis.

LoadRunner supports testing virtually any protocol: HTTP/HTTPS, SOAP, REST, Citrix, SAP, Oracle Forms, JDBC, and many others. This protocol breadth is why enterprises use it — one tool for complex multi-protocol applications.

LoadRunner vs. LoadRunner Cloud vs. LoadRunner Professional

Before starting, clarify which product you're using:

  • LoadRunner Professional (formerly LoadRunner) — desktop tool, virtual users licensed per count
  • LoadRunner Cloud (formerly StormRunner Load) — cloud-native, pay-per-use VUs
  • LoadRunner Enterprise (formerly Performance Center) — enterprise management with additional governance features

This tutorial covers LoadRunner Professional, the most common on-premise version.

Installation

LoadRunner Professional requires Windows. Download from the Micro Focus/OpenText portal with a valid license. The community edition offers 50 free virtual users — sufficient for learning and small-scale testing.

System requirements:

  • Windows 10/11 or Windows Server 2019/2022
  • 8GB RAM minimum (16GB recommended for controller)
  • 10GB disk space

The installer includes VuGen, Controller, and Analysis. Install all three.

VuGen: Recording Your First Script

Creating a New Script

  1. Open VuGen
  2. File → New Script and Solution
  3. Select protocol: Web - HTTP/HTML for web applications
  4. Name the script and choose a save location

Recording a User Journey

VuGen embeds a browser for recording:

  1. In your script, click Record
  2. Enter your start URL (e.g., https://example.com)
  3. Choose recording mode: HTML-based (recommended for web)
  4. Click Start Recording — VuGen opens a browser
  5. Perform the user actions you want to simulate (login, browse, checkout)
  6. Click Stop in VuGen

VuGen generates a C-language script that replays your recorded actions.

Understanding the Generated Script

A recorded script has this structure:

Action()
{
    web_url("Home Page",
        "URL=https://example.com/",
        "TargetFrame=",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t1.inf",
        "Mode=HTML",
        LAST);

    web_submit_form("login",
        "Snapshot=t2.inf",
        ITEMDATA,
        "Name=username", "Value=testuser", ENDITEM,
        "Name=password", "Value=password123", ENDITEM,
        LAST);
    
    return 0;
}

The web_url function navigates to a URL. web_submit_form submits form data. Each function corresponds to an action you performed during recording.

Parameterization

Hardcoded usernames in a load test mean all virtual users log in as the same user — unrealistic and likely to cause server-side conflicts. Parameterize values to use different data for each VU.

  1. Right-click testuser in the script
  2. Select Replace with Parameter
  3. Create a parameter named username with type File
  4. Create a CSV file with usernames:
username
user001
user002
user003

The script now uses {username} as a placeholder, pulling values from your CSV file during execution.

Correlation

Dynamic values (session tokens, view states, order IDs) must be extracted from responses and reused in subsequent requests. This is correlation.

VuGen has automatic correlation detection:

  1. Run the script once
  2. VuGen highlights values that differ between recording and replay
  3. Right-click a highlighted value → Create Correlation Rule
  4. VuGen adds a web_reg_save_param call to extract the value

Manual correlation example:

// Extract session token from response
web_reg_save_param("session_token",
    "LB=session_id=",
    "RB=;",
    "Search=Headers",
    LAST);

// session_token is now available as {session_token}
web_url("dashboard",
    "URL=https://example.com/dashboard?session={session_token}",
    LAST);

Adding Think Time

Real users pause between actions. Think time simulates this:

lr_think_time(3);  // 3-second pause

Without think time, virtual users hammer the server as fast as possible — unrealistic unless you're testing maximum throughput.

Script Verification

Before running a load test, verify your script executes successfully as a single user:

  1. Press F5 or click Run (single VU)
  2. Check the output log for errors
  3. Verify the run log shows expected pages and requests
  4. Check that parameterized values are being used

Fix all errors before moving to the Controller.

Controller: Designing Your Load Scenario

Opening Controller

File → Open in Controller, or open Controller directly and load your script.

Scenario Design

A scenario defines how virtual users execute your script:

Manual Scenario:

  • Set number of VUs (e.g., 100)
  • Define ramp-up: start 10 VUs every 30 seconds until reaching 100
  • Set duration: run at peak load for 30 minutes
  • Define ramp-down: stop 10 VUs every 30 seconds

Goal-Oriented Scenario:

  • Define a target metric: "achieve 1000 transactions/second"
  • Controller adjusts VU count automatically to reach the goal

For beginners, start with Manual Scenario.

Load Generator Setup

For small tests (< 100 VUs), run load generators on the same machine as the Controller. For larger tests, use dedicated load generator machines — add them in Controller → Load Generators.

SLA (Service Level Agreement) Configuration

Define what "passing" means:

  1. Controller → Design → SLAs
  2. Add SLA for Average Response Time: threshold = 2 seconds
  3. Add SLA for Error Rate: threshold = 1%
  4. Add SLA for Transaction Rate: minimum = 500 TPS

If thresholds are exceeded, the test is marked as failed in Analysis.

Running the Test

  1. Click Run tab
  2. Review the scenario configuration
  3. Click Start Scenario
  4. Watch real-time graphs: response time, throughput, VU count, errors

Monitor during execution for:

  • Response time climbing as VU count increases (bottleneck)
  • Error rate spiking (server under stress)
  • Throughput plateau (server capacity reached)

Stopping the Test

After the ramp-down completes, Controller saves results to the analysis data directory automatically.

Analysis: Understanding Results

Opening Analysis

Open the results directory in Analysis. It processes raw data into charts and statistics.

Key Reports

Transaction Summary: Pass/fail counts per transaction, average response time, 90th percentile response time, minimum, maximum.

Response Time vs. VUs: Shows how response time degrades as VU count increases. The inflection point is your system's capacity limit.

Throughput (Hits/Second): Requests per second over time. Should be stable at peak load if the server is healthy.

Error Rate: Percentage of requests returning errors. Above 1-2% usually indicates a problem.

Server Resources: If you have server monitors configured (CPU, memory), these graphs show correlation between server resource usage and performance degradation.

Identifying Bottlenecks

Common patterns in Analysis:

  • Response time climbs with VU count → server CPU or application bottleneck
  • Response time flat then spikes → connection pool exhaustion or thread limit
  • High error rate → server timeout or crash under load
  • Throughput plateau → network or application throughput limit

Common Beginner Mistakes

Not correlating dynamic values: Script fails for multiple VUs because session IDs are hardcoded from recording. Use correlation.

No parameterization: All VUs use the same credentials — causes authentication failures or unrealistic server caching behavior.

No think time: VUs hit the server at maximum speed — tests max throughput but not realistic concurrent user load.

Recording on localhost: Record against a staging environment. Localhost recording captures localhost-specific requests that don't apply to the actual server.

Testing production without coordination: LoadRunner tests generate significant load. Always coordinate with ops before testing production; preferably test staging.

LoadRunner vs. JMeter

LoadRunner JMeter
Cost Expensive (enterprise license) Free
Protocol support Very broad Good (plugins needed for some)
Recording Built-in, polished Basic
Analysis Excellent, built-in Requires plugins/export
Script language C (VuGen) GUI + Java groovy
Enterprise features Strong Limited
Cloud execution LoadRunner Cloud BlazeMeter/others

JMeter is the right choice for most teams. LoadRunner is justified when you need enterprise governance, complex protocol support (SAP, Citrix, Oracle Forms), or your organization already has licenses.

Next Steps

After getting your first script working:

  1. Add more transactions to simulate a realistic user journey (not just login)
  2. Set up server-side monitoring (CPU, memory, database) in Controller
  3. Run a baseline test before any major release
  4. Compare baseline to post-deployment to detect regressions

LoadRunner's depth becomes apparent as you go beyond the basics — protocol-level debugging, custom request functions, distributed load generation, and integration with CI pipelines via the LoadRunner CLI. Start simple, build familiarity, then expand.

Read more

Start now free