Load Runner Fundamentals

Download as pdf or txt
Download as pdf or txt
You are on page 1of 75

TSL

LoadRunner Fundamentals

TRAINING SCHEDULE
Day 1 Basics of Performance Testing Why LoadRunner? Basics of LoadRunner Components Installing LR Components Planning an Effective Load Test Scenarios Using Run-Time Settings Scenario Execution Scheduling Scenarios Performance Monitors Results Analysis Day 2 Record and Replay Transactions Parameterization Correlation Verification Analyzing Graphs/ Discussion

Basics of Performance Testing

1: Basics of Performance Testing

What is Testing?
A process to ensure the accuracy, completeness and quality of developed software. "... the process of exercising or evaluating a system or system component by manual or automated means to verify that it satisfies specified requirements or to identify differences between expected and actual results ..." . Manual Testing The The part of software testing which requires human input, analysis, or evaluation.

Automation Testing The software testing where the input, analysis etc, are done through automated means. We use test automation tools like QTP , LoadRunner, Silktest, Test Director.

1: Basics of Performance Testing

Types of Testing:
Functional Testing- The testing that ignores the internal mechanism of a system or component and focuses solely on the outputs generated in response to selected inputs and execution conditions. It ensures that the program physically works the way it was intended and all required menu options are present. It also ensures that the program confirms to the industry standards relevant to that environment.

Non-functional Testing- Non Functional Testing suggests "HOW WELL" the product behaves. This HOW WELL definition is with reference to ease of use, reliability, performance, security etc.

1: Basics of Performance Testing

Performance Testing
Performance testing is testing that is performed to determine how fast some aspect of a system behaves under a particular workload. Performance testing is carried out to prove that an application meets certain performance requirements set down by the customer.

Primarily used to determine: Capacity of existing systems. Benchmarks for future systems. Degradation with various loads.

1: Basics of Performance Testing

Need of Performance Testing


Speed Does the application respond quickly enough for the intended users?

Scalability (Capacity) Will the application handle the expected user load and beyond?

Stability Is the application stable under expected and unexpected user loads? What happens if user gets disconnected or web server gets down?

Confidence Are you sure that users will have a positive experience on go-live day?

1: Basics of Performance Testing

Examples of Performance Test Objectives

1: Basics of Performance Testing

Manual Testing is Problematic

1: Basics of Performance Testing

Limitations of Manual Testing


How can site developers generate enough load to enable testing? How can I obtain sufficient testing personnel and client machines? How can I synchronize users? How do I measure the results? How can I repeat the test after identifying and fixing problems?

Why LoadRunner?

2: Why LoadRunner?

Why Load Test your Application?


Load testing your application provides many potential benefits: Preventing costly failures of mission-critical applications. Assuring performance and functionality under real-world conditions. Locating potential problems before your customers do. Reducing development time. Reducing infrastructure costs.

2: Why LoadRunner?

LoadRunner Solution

2: Why LoadRunner?

LoadRunner Solution
LoadRunner eliminates the need for hundreds of testers and massive resources. Instead, virtual users execute test steps which have been recorded so they can be repeated. These test steps are saved as scripts and are organized as scenarios, eliminating the need to coordinate testing manually.

2: Why LoadRunner?

LoadRunner Terms and Definitions


Vuser: Virtual users or Vusers emulate the steps of the real users. The steps that Vusers perform are recorded in a Vuser script. VuGen: Virtual User Generator (VuGen) records Vuser scripts that emulate the steps of real users using the application.

Scenario: A scenario is a file that defines the scripts to execute, the number of Vusers to run, the goals of the test, the computer that will host the Vusers, and the conditions under which the load test runs.

Controller: The Controller is the machine you designate to manage and maintain your scenarios and allows you to control all the Vusers of the scenario from a single location.

Performance Monitors: Real time monitors capture performance data across all tiers, servers and network resources and display information on the Controller.

Basics of LoadRunner Components

3: Basics of LoadRunner Components

Basics of LoadRunner Components

Convert this to Text!!

3: Basics of LoadRunner Components

LoadRunner Launch Screen

3: Basics of LoadRunner Components

How do LoadRunner Components interact?

3: Basics of LoadRunner Components

Load Testing Process

3: Basics of LoadRunner Components

Load Testing Process


Planning Gather and document all relevant information about the system for the load test. Create Vusers Use the Virtual User Generator (VuGen) to automate user actions of the selected business processes that you will test. Create Scenarios Use LoadRunners Controller to set up the load test environment by putting together the target hardware, the intended Virtual Users (Vusers), and the conditions under which the load test will be run. Run Scenarios & Analyze Results Run the load test and compile the results for analysis using LoadRunners Controller. Use the analysis tools to organize and display the results. Tune the System Analysis of results should reveal areas of the system that require adjustment. Once the adjustments are made, repeat the load test to confirm that system adjustments had the desired effect.

3: Basics of LoadRunner Components

LoadRunner Expert Workflow The Big Picture

3: Basics of LoadRunner Components

LoadRunner Components in the Workflow

Installing LoadRunner Components

4: Installing LoadRunner Components

Installing LR Components

4: Installing LoadRunner Components

Installing VuGen

4: Installing LoadRunner Components

Installing the Controller

4: Installing LoadRunner Components

Installing the Load Generator

4: Installing LoadRunner Components

Installing Analysis

Planning an Effective Load Test

5: Planning an Effective Load Test

Planning an Effective Load Test


Expert Workflow

5: Planning an Effective Load Test

How to Define Goals


When you define goals, the first step is to channel general application performance expectations into conceptual goals. Conceptual goals should outline all of your load objectives

Some examples of conceptual goals and their relative priority might include the following: A high-priority example would be the responsiveness of a Search function. Are we able to get search results within a reasonable time? A second example is the system administrator's concern that the Update transaction functions well during heavy usage.

In the initial stages, jotting down immeasurable goals will allow later filtering in order to arrive at more focused goals, as well as to cover all objectives for load testing.

5: Planning an Effective Load Test

Gather System usage Data


Expert Workflow

5: Planning an Effective Load Test

Business Process
A business process is a set of actions or user steps performed within an application to accomplish a business goal.

Examples of Business Process

5: Planning an Effective Load Test

Gathering System Usage Data


By gathering system usage data you can: Decide which business processes to record Isolate peak loads and peak load times Document user actions and valid input data for each business process. The first task is to understand the application to be load tested. This may involve: First-hand use of the site. Consultation with administrators to understand the nuts and bolts of the infrastructure. Consultation with executives to understand the aspirations and expectations of the site. Research of competing sites to understand the level of service in the marketplace.

5: Planning an Effective Load Test

Which processes to test ?


Mission Critical Transactions on which your business depends on.

Heavy Throughput Business processes that may not be mission-critical but are very popular.

Dynamic Data Any business process that relies on dynamic content is more likely to fail during periods of heavy load than one based on static content.

5: Planning an Effective Load Test

Business Processes to record

5: Planning an Effective Load Test

Business Processes to record

5: Planning an Effective Load Test

Business Processes to record

5: Planning an Effective Load Test

Measure Steps by Defining Transactions


LoadRunner Transaction A LoadRunner transaction is an end-to-end measurement of time elapsed in the execution of one or more steps in a business process.

Preferred and Unacceptable Response Times


Types of Response Times Preferred response time is the time the business process takes to complete under ideal conditions. Preferred response time range is the time you want the business process to complete, having taken slowdown factors into consideration.

5: Planning an Effective Load Test

Documenting User Steps and Input Data


Determine Valid Test Data to Use Valid Test Data Sources Master Data User Generated Data External Data

5: Planning an Effective Load Test

Think Time
LoadRunner Think Time is a measurement of the time that a real user takes to pause between the execution of steps.

Concurrency
A concurrency is a set of users acting upon an application in a similar manner at the same time. Concurrency occurs on three levels: Application Level Business Process Level Transaction Level How many users are active on the system? How many users are buying tickets? How many users are buying tickets now?

5: Planning an Effective Load Test

Application Concurrency
A Task Distribution Diagram formats the business process and its volume across a time line.

5: Planning an Effective Load Test

Business Process Concurrency

5: Planning an Effective Load Test

Transactional Concurrency
How many transactions will need to be run per minute if a load test has to be run for two hours with 5000 users, assuming an average length of five minutes?

5: Planning an Effective Load Test

Question key points: Duration of Load Test: 120 minutes Number of Concurrent Users: 5,000 Average Length of a Transaction: 5 minutes Number of Transactions/ min: ???

Solution: No of transactions performed in 2 hours = by a single user = No of transactions performed in 2 hours = by 5000 users = Number of Transactions/ min = = Duration of Load Test / Average Length of a Transaction 120 / 5 or 24 Transactions No of transactions performed in 2 hours by a single user * Number of Concurrent Users 24 * 5,000 or 120,000 No of transactions performed in 2 hours by 5000 users / Duration of Load Test 120,000 / 120 or 1,000 Transactions / min

5: Planning an Effective Load Test

User Profile
Profiling Users Helps emulate real world conditions. Provides tuning guidelines for the system. Increases customer satisfaction and revenue.

5: Planning an Effective Load Test

Peak Load
Business processes with the highest levels of load will be the most important to load test. In this example the peak load for the Search BP is 5000 simultaneous users for the period of 10:00 to 12:00.

5: Planning an Effective Load Test

Quantifying Load Testing Goals

5: Planning an Effective Load Test

Analyze the System Under Test


Analyzing the System: Allows you to setup LoadRunner monitors. Allows you to effectively coordinate with backend experts. Provides system information that helps isolate performance problems. Sources of System Information: System Administrators Backend experts Application experts Database Administrators

5: Planning an Effective Load Test

Understanding the System Components

System checklist

5: Planning an Effective Load Test

Business Process Mapping to Infrastructure Components

5: Planning an Effective Load Test

Monitoring Application Components

5: Planning an Effective Load Test

Minimum Hardware Recommendation

Confidential L&T Infotech

5: Planning an Effective Load Test

About the Test Environment


The test environment: Should mirror the production system Needs business processes that are functioning correctly before running the load test Should include Benchmark runs which validate the test environment Must contain sufficient hardware to generate the load test.

5: Planning an Effective Load Test

Benchmarking Run
To validate that there is enough test hardware available in the test environment, benchmark the BPs against the testing hardware. Take a business process and execute a small number of users against the application. Validates the functionality of the BP Potentially exposes unknown data dependencies Establishes the user footprint Evaluate the testing infrastructure against the footprint. Do I have enough hardware to generate the user load? Do I have enough memory? Do I have enough CPUs?

Scenarios

6: Scenarios

Scenarios
A scenario is a file that defines the Vusers to execute, the number of Vusers to run, the goals of the test, the computer that hosts the Vusers, and the conditions under which to run the load test. Elements of Scenario:

6: Scenarios

Scenarios define the overall load test execution


Which scripts are to be executed?

How many virtual users will execute each script, and how suddenly or gradually should they begin?

Which load generators will host the Vusers?

What is the goal of the load test?

6: Scenarios

Controller organizes & manages the scenario elements


Before scenario execution used to design the scenario used to initiate the scenario run During scenario execution controls each Vuser (initialize, run, pause, stop) displays the execution status and messages of each Vuser monitors system and network resources After scenario execution collects and organizes performance data launches the Analysis tools (optional)

6: Scenarios

Scenario Outlines - Examples

6: Scenarios

Creating a New Scenario

6: Scenarios

Select Vuser Scripts

6: Scenarios

Vuser Groups

6: Scenarios

Adding a Vuser Group

6: Scenarios

Modifying the Vuser Group Settings

6: Scenarios

Manual vs. Goal-Oriented Scenarios


Manual Scenario Manual control over how many Vusers run and at what times. Add, start, and stop Vusers interactively during a scenario run. Goal-Oriented Scenario Goal may be throughput, response time or number of concurrent Vusers. LoadRunner manages Vusers automatically. Cannot add, start, or stop Vusers interactively during a scenario run.

6: Scenarios

Selecting Load Generators for your Scenario

6: Scenarios

Adding a Load Generator

6: Scenarios

Defining a New Load Generator

6: Scenarios

Connecting to a Load Generator

6: Scenarios

Configuring Load Generator Settings

6: Scenarios

Assigning User Profiles to Load Generators


Example:

6: Scenarios

Assigning Number of Vusers

Simple Scenarios Have a single user script. Assign 100% of Vusers to the script to profile a group of users performing the same action Multiple Script Scenarios Use several scripts. Assign a percentage of the total Vusers to each profile.

Using Run-time Settings

You might also like