LoadRunner IMP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

LoadRunner Notes

** Read Me
This document is created with the intention that it will help students with the topic covered
in the class. Pls feel free to add, if something is missing.

NOTE:
1) Imperatively, don’t delete anything from this doc.
2) Please don't scribble anything on this doc.
3) I have created a section called “interview questions”. Please post-interview questions
and relevant answers (if you kn bbv f to mmow them).

General Section

Downloads
● MicroFocus StormRunner Load
● MicroFocus LoadRunner V12.50 Community version
○ DropBox Link 1 | DropBox Link 2

LoadRunner Certification `
https://inter.viewcentral.com/events/cust/search_results.aspx?
cid=microfocus&pid=1&lid=1&tstamp=1526547153458&event_id=
653&postingForm=catalog.aspx
1. MicroFocus Certification

https://drive.google.com/open?id=1Z4DQp0Dkjf2RCUPfoJnqHmuDt2BpxUXa

Page 1/29
https://www.guru99.com/guide-to-download-and-install-hp-loadrunner-12-0.html#1

Essential Cloud-based Load Testing ToolsIi9io bhi ok i ko cb


+kinn
https://geekflare.com/essential-tools-to-perform-stress-test-online/
1. Load Impact
2. Flood IO
3. Loader
4. `Load Storm
5. Blazemeter * (compatible Apache JMeter Jenkins Selenium)
6. Load Focus
7. OctoPerf
8. Other
a. OATS: Oracle Applications Testing Suite
b. NeoLoad
c. ReTrace APM
d. Ranorex Studio

Open Source Tools


● TestQuality https://github.com/marketplace/testquality
● Instabug https://github.com/marketplace/instabug

Performance Testing Calculator


● PerfTractor: Performance Testing Tool Prices and Calculators
● Little's Law Calculator : calculate the
○ Number of Vusers
○ Pacing Time (seconds)
○ Total Test Data required
○ Total Virtual Users that can run on that Load Generator
● Demo Links: Lists of sample web applications which will help to learn performance
testing tool concepts

Page 2/29
Lectures

Section-01
Deviations in results are called
● Functional Testing - Bugs / Defects
● Performance Testing- Bottlenecks
● Security Testing - Vulnerabilities

(1-2) Instructor Bhaskar V

(1-3) Types: Software Testing


● Functional Testing
○ System Testing
○ System Integration Testing
○ Regression Testing
○ UAT

● Non-Functional Testing (NFT)


○ Performance Testing
○ Security Testing, Penetration Testing
○ Compatibility Testing
○ Usability Testing
○ Failover Testing
○ Scalability Testing
○ Accessibility Testing

Performance testing tools in Market


● LoadRunner (80% market share)
○ StormRunner
○ Performance Center
● RPT (IBM)
● MicroSoft VSTS (Visual Studio Test Suite)
● Jmeter (Open Source*)
● NeoLoad

Page 3/29
● WebLoad
● Oats
● OctoPerf https://octoperf.com/tutorials/
● Kieker Tools http://kieker-monitoring.net/kieker-tools/

* Performance testing is not the only NFT

Section-02

(2-10) Server
1. The software needs to understand clients request
2. Process the request
3. Send the response back
Combination of H/W & S/W, s/w by itself is of no use, it needs to be installed on h/w

(2-11) Understanding Servers


● File Servers understands only requests about files (and nothing else)
● Print Servers understands only requests about prints
● Database Servers understands only requests about data (Oracle, DB2, MS SQL server)
○ using SQL queries
○ Select * from table1 where username = “xyz”;
● Application Servers understands only requests about applications / AP

(2-12) Application Layers


● Presentation Tier / Presentation layer (PL): Accepts user inputs, displays data & Any
results on the UI
● Logic tier / Business Logic Layer (BLL): processes commands & makes logical
decisions & performs calculations
● Data Tier (DML): here the information is stored & retrieves from the DB file system

(2-13) Architecture

Two-Tier Architecture
1. A thin client (websites, accessed through browsers)

Page 4/29
a. Layer 1: PL is on the client
b. Layer 2: BLL + DML is on the server
2. Thick / Fat Client (Ex: mobile apps,)
a. Layer 1: PL + BLL is on the client
b. Layer 2: DML is on the server

Three Tier Architecture


1. Layer 1: PL on client
2. Layer 2: BLL on APP server
3. Layer 3: DML on DB server
a. Advantages: separate processor might be present for each application layer
b. This architecture is simpler to manage (than the fat client model & gives better
performance than a thin-client model)
c. Can be scaled easily

(2-15) N-Tier Architecture


● Instead of 4 tier its N-tier
● It's a STATELESS PROTOCOL

Layers
1. Layer 1: PL on client
2. Layer 2: PL build on Webserver
3. Layer 3: BLL on APP server
4. Layer 4: DML on DB server

Transaction Response Time represents the time taken for the application to complete a
defined transaction or business process

Scalability
● Size scalability is the maximum number of processors that a system can
accommodate. To scale vertically (or scale up/down) means to add resources to (or
remove resources from) a single node in a system, typically involving the addition of
CPUs or memory to a single computer.
● Scale up (vertical scaling) / Scale out (horizontal scaling)
● :) What does “scale out” vs. “scale up” mean?

Page 5/29
(2-16) Know Your Servers

APM: Application Monitoring tools


1. HP-Diagnostics
2. DynaTrace
3. APP Dynamic

(2-17) Protocols
4. Set of rules
5. Server has to understand the request (from client), at the same time the client needs
to follow protocol(s)
6. EX: LR Protocols
○ HTTP / HTTPS / FTP
○ SMTP (email) / SNMP / TCP
○ https://performanceengineeringsite.wordpress.com/2016/12/20/loadrunner-
protocols-list/
7. HTTP Protocol
○ Rules
■ Every request has a header & Body
■ Header has key value pairs
■ Header is mandatory & body optional
■ HTML is used in body .. etc
○ Web Server is full implementation of HTTP Protocol
○ Web Browser is Partial implementation of HTTP Protocol

Section-03

(3-18) LR Installation

LR 12.50
8. There's a significant difference in features of LR 12.50 vs 12.53
9. LR 12.50 is a community edition, free for life with 50 Vusers
10. MicroFocus LoadRunner V12.50 Community version
○ DropBox Link 1 | DropBox Link 2

11. Once installed check for


○ VUGen

Page 6/29
○ Controller
○ Analysis

Section-04

(4-19,20) What is Performance Testing


12. It’s testing an application for speed, stability & scalability in ‘Production like
environment’ under virtual user load to meet Non-Functional requirements (NFRs)
○ Speed: How fast the application responds to your request. In other words,
Response time should be less
○ Stability: Performance should not degrade even after using the Application for
very long time.
○ Scalability: Application’s ability to handle increasing user (load) without
performance degradation
13. SLA: Service Level Agreement
14. Purpose of Performance Testing
○ To identify Performance Bottlenecks
○ Functionality of the application should not be changed under real world
conditions
○ Key Notes: Performance Tester are required to identify Performance
Bottlenecks but not Defects (Bugs)

Page 7/29
Production Like Environment

(4-21) Abbreviations
15. PT: Performance testing
16. NFT: Non-Functional testing.
17. AUT: Application Under Test
18. SUT: System under test
19. PTLC: Performance Testing Life Cycle
20. WLM: Work Load Modeling
21. Response Time - Time is taken by the system to respond to a specific transaction
request
22. Think Time –Time is taken for selecting a new transaction after receiving the response
for the previous transaction.
23. Throughput - Transactions per second, Bytes per second
24. 90 percentile response time
○ When we execute a Performance Test, the same transaction will be executed
multiple times.
○ Since the same transaction is executed multiple times, multiple response times
are captured
25.

(4-22) Performance Testing VS Performance Engineering


26. Performance testing is a subset of performance engineering
27. Performance Testing usually deals with identifying issues in the Application Under
Test
28. PE not only deals with identifying the issues but also eliminating the same.

(4-23) Performance Testing Life Cycle (PTLC)


29. NFRs are gathered from Stakeholders / SME
30. Challenges for NFR Gathering
○ Clients implementing PT for the first time are not aware of what information to
provide, its your responsibility to provide a list (SLA, peak load, volumes,
Performance critical transactions, )
31. Slide-33

Page 8/29
Section-05

(5-24,25) NFR Gathering

Infrastructure Details
32. As part of NFR gathering, PT team is supposed to capture the configuration details of
both Production Environment and Performance testing environment
33. Data collected
○ Operating System of each server– OS version in
■ Solaris 9, AIX, RedHat linux
○ Hardware configurational of each server –
■ Number of CPU’s, speed, memory etc..
■ 1.6 GHz processors with 32MB Cache, 16GB memory, 100GB Hard Disks
○ Details of Server Clusters.
○ Support Software on each server – Web / App server, Database
■ WebLogic 8.1 Premium Server, Oracle 10G Enterprise
34. Example
○ Apache Tomcat Server 8
○ 1.6GHz processors with 32MB Cache, 16GB Memory, 100GB Hard Disks, HP-UX
and Java ES pre-installed

NFR Types
● Performance Critical Transactions
● Business Critical
● High Resource Intensive Requirement

Transaction Details
● As part of NFR gathering, PT team is supposed to capture a list of performance critical
transactions.
● What are Performance Critical Transactions:
○ Transactions which are executed Frequently.
○ Transactions which are critical for Business.
○ Transactions that are suspected to have high resource requirements.
● Example: For a banking application, following transactions are critical
○ Account Summary Details
○ Checking Transaction History
○ Balance Transfer
○ Login

Page 9/29
○ Logout
● Following transactions are not critical
○ Change Password
○ Change Username
○ Change Theme
○ Order Checkbook
● Business Critical TXNS: txns that are not performance critical but are revenue
generating for client (so make sure they are included in tests) was
○ Open New Savings A/C
○ Open FD (Fixed Deposit) / CD (Certificate Deposit)
○ The above txns may not happen daily, but bring revenue everytime a new A/C
is created
● Banking TXNs Suspected to have High Resource Intensive Requirement (& are
Business Critical)
○ Transaction History of last 5 years

Scalability Related data


● Stakeholder / client to provide this data
● Few years down the line, there is a chance that user load on the application might
increase because of the business growth.
● Because of this increased load, the performance of the application might get affected.
● So, the performance Testing team is supposed to capture the future user volume
growth.
● Example: There is an 80% increase in user load annually.
○ If there are 1000 users currently
○ For Performance test you’ll do a 1000 Vuser test
○ For Scalability test you’ll do a 1800 Vuser test

WorkLoad Related data


● Application usage patterns and volumes for each performance Critical Transaction is
captured as part of this model.
● This data is identified by
○ Interviewing Clients
○ Analyzing existing logs (using SPLUNK)
● Example : (Transactional Volumes - Transactions /Hr), AUT -Amazon

Page 10/29

Data related to response times and other metrics


● As part of NFR Collection, the Performance Testing Team is supposed to capture
Response Time (RT) related data.

○ M

Page 11/29
● After the Performance test execution, the test results are compared with the SLA to
determine if the application meets performance expectations
● Examples:
○ When application is subjected to 1000 concurrent user load, “Login”
transaction should not take more then 2 seconds to complete
○ When an application is subjected to 1000 concurrent user load, CPU utilization
of the WebApp Server should never cross 60%. (70% industry standard)

Section-06

(6-26/28) : WLM-Workload Modeling

Example 1
35. Assuming the Client provides the following “WorkLoad Related Data”

36.

37.

Page 12/29
38.

39.

40. Usually Approach #2 is followed (using less Vusers) in both the cases (above & below)

Page 13/29
41.
42. Think Time Vs Pacing: Pacing in load testing refers to the time between the iterations
of your test scenarios. This is unlike Think Time, which refers to the delay between
each component of the Transaction. Pacing allows the load test to better simulate the
time gap between two iteration

● Example 2
43.

44.

Page 14/29
45.

46.

47. Thats where Little's Law comes in handy


48.

Page 15/29
49.

(6-29,30) Little's Law

● Performance Testing Calculator *


● Understanding (TPS), Little’s law
● JMeter – Application of Little’s Law to Workload Models
● Estimating maximum users that an application can support
● Little’s law in Performance Testing
● http://www.wilsonmar.com/1loadrun.htm#Goals

Number of Items in the system = Arrival Rate x Response Times


X = λN

Number of vusers = TPS * (Response Time + Think Time + Pacing)


Number of vusers = TPS * (Script execution time)
N = TPS * (Rt + Tt + Pacing)

(or)

Average number of users in the system = throughput * average response time


N = X*(R+Z)

N = Number of users
R = average response time (now you know, it can be pacing too)
Z = Think Time
X = Throughput (i.e. TPS)
* R+Z = Script execution time (SET)

Page 16/29
X = TPS = (TPH/3600)
I.e Transactions per Sec = (Transactions per Hour / 3600)

Example 1
If N = 100, R = 2 sec,
100= (2+Z)*X and hence –> If Z=18, X = 5

Example 2
6 login transaction per hour (6 TPH), 2 concurrent users, Script Execution Time is 10 mins,
calculate pacing?
6 TPH, N=2, SET = 10m= 600 sec
X = TPS = TPH/3600 = 6/3600 =1/600

N = TPS * (Rt + Tt + Pacing) = TPS * (SET + Pacing)


2 = (1/600)* (600+Pacing)
2*600 = (600+Pacing) = 1200
Pacing = 1200-600 = 600 Sec = 10 min

* Example 3
First 3 columns data (BP, N, TPH) are provided by the SME / Business team, the rest need to
be calculated

Page 17/29
● SET, is not provided by SME, its calculated

by running the LoadRunner script (without think time with 1 Vuser)


● In real time projects you will have 30-40 Business Processes which means you will
create 30-40 scripts.
SET + Pacing = N/TPS
Pacing = N/TPS - SET

Workload Modeling:
Workload model is simply a set of business transactions performed by given concurrent users
for a given time to analyze the behavior of the system under test.

Section-07

(7-31/34) : LR Components
1. VuGen / Virtual User Generator
a. You can use Fiddler / web custom request if you can't record on VuGen
2. Controller
3. Analyser
4. Load generator (LG) / Load injector / Agent machine
Use

Page 18/29
(7-35) : LR Architecture

(7-37) : Calculation of Load Generators (LGs)

● Number of Vusers an LG can support totally depends on the Memory FootPrint


● One group can run on multiple LGs & Multiple LGS can have multiple groups
● Controller component of LR has the ability to control multiple load generators
● Vusers scripts will be downloaded to LG machines during the scenario execution. So,
results needs to be collated by controller from all the LG’s after the execution.
● User needs to have the appropriate license to access Load Generator and Controller

● ADVANCED Reading:
○ Memory Management in LoadRunner
○ How Can I Calculate the Number of Load Generators Required for TruClient
Scripts

Page 19/29
Memory FootPrint
● Will vary from protocol to protocol & tool to tool
○ HTTP / HTML protocol in LR is 2.3mb RAM for each user
○ EX: For a server / PC with 500mb RAM you can run = 500/2.3= 217 Vusers (max)
○ You don’t push to the max, give some slack & run 180-200 Vusers
○ Memory FootPrint SpreadSheet
● FootPrint by Protocol
○ Web protocol: 2MB memory / user
○ CITRIX protocol: 10 MB memory / user
○ AJAX protocol: 25 - 30 MB memory / user
○ SAP GUI protocol: 10 MB memory / user
○ Any other GUI protocol: 10 MB memory / user
● More on AJAX / TruClient FootPrint
● Wilson Mar- AJAX RIA web app load testing using LoadRunner

(7-3) : LR nu
A
For transactions:
lr_start_transaction(“Transaction_name”);
lr_end_transaction(“Transaction_name”,LR_AUTO);

Text check point:

Page 20/29
web_reg_find(“text=webtours”,LAST); Before a request

Image Checkpoint:
web_image_check(“”,LAST); After a request

Rendezous pt:
To make all Vusers would run simultaneously a particular transaction, should be added before
request
Useful while doing real execution.
lr_rendezous(“transaction_name”);

Section-9

Basic C functions and LR functions


atoi()
itoa()
lr_eval_string()
lr_save_string()
lr_save_int()

Section-10

Parameterization

(10-83) Parameterization - Part-1

lr_exit : exits if
the function / condition fails & executes vuser_end marking the transaction / test as FAIL

Page 21/29
(10-85) Parameterization - Part-3

Converting LR Parameters into a String

Page 22/29
Lr_output_message

Section-11

Data Type / Variables


There are five basic data types associated with variables:
1. int - integer: a whole number.
2. float - floating point value: ie a number with a fractional part.
3. double - a double-precision floating point value.

Page 23/29
4. char - a single character.
5. void - valueless special purpose type which we will examine closely in later sections.

Data Types https://www.le.ac.uk/users/rjm1/cotter/page_19.htm

Correlation

(11-87) Why Correlation

Page 24/29
Section-12

Performance Bottleneck Analysis:

● What are Bottlenecks?


● Sources of data
○ Traces
○ Counters
● Load Testing tool data
● Typical Parameters monitored for Bottleneck analysis
● Bottleneck Analysis – Some Heuristics
● Performance Tuning – A Sample Case Study

SAP Protocol
http://ishatrainingsolutions.org/sap-gui-loadrunner-recorded-videos/
● SAP Architecture – Brief Overview
● SAP GUI – Understanding SAP MM Business flows
● Enable SAP GUI recording on SAP servers
● VUGEN
○ Record / PlayBack
○ Add Transactions
○ What are Objects and Control ID’s?
○ Define control ID in the lr_strings.h
○ Directly use Control ID in the script
○ Insert Steps Interactively into a SAP GUI Script
○ Replace Masked Password
○ Conversions
■ Integer
■ String
■ LR Parameter
■ Convert from LR parameter to string and vice Versa
○ Retrieve Information
○ Error handling
○ Add Verification Points
○ Dealing with Optional Windows
○ Using Control ID’s with LR Parameters
○ Parameterization
○ File operations

Page 25/29
Advanced Topics / Further Reading

Books
● “Surviving the Top Ten Challenges of Software Testing” written by William E. Perry
and Randall W. Rice.
● Manual Testing Help – Version 1
● Manual Testing Help (Practical Software Testing) – Version 2
● Freelance Software Testing Job Opportunities
● https://www.softwaretestinghelp.com/software-testing-books/

LoadRunner VTS (Virtual Table Server)


● NWS Northway Solutions Group- Blog
○ Introduction to the New HPE LoadRunner Virtual Table Server (VTS) – Part 1
○ Install and Setting up VTS – Part 2
○ Coding for VTS – Part 3
○ Advanced Topics in VTS – Part 4
● Download MicroFocus VTS (Virtual Table Server)
● MicroFocus
○ (VTS) - A quick how to guide.
○ https://admhelp.microfocus.com/lr/en/12.60/help/WebHelp/Content/VTS/
c_SPS_overview.htm
● Videos
○ How to use Virtual Table Server
○ How to create VTS Multiple Instances in Loadrunner

VTS Definition
● https://www.youtube.com/watch?v=BhN0Pp4I98M
● VTS is a tool (built into LoadRunner) that shares data & parameters between
LoadRunner Vusers (during runtime in the controller).
● Unlike standard parameterization VTS uses a centralized repository to store data,
therefore data can be passed between vusers during the load testing
● VTS is always up & running as a service & doesn't require a user to be logged on system
● having Access from script 'disabled' will not allow Access to any script
● Enable Access from the script, then change API Access port #

Page 26/29
Noise Testing
● http://www.starbase.co.uk/blog/hp-loadrunner-12-02-second-look-at-noise-
testing1.html
● Many applications where 85% of users just hit the homepage and don’t do anything
useful i.e. they are just background noise.
● The good thing is that recreating this noise will effectively be ‘free’, i.e. no virtual
user license will be consumed – thus allowing the full license to be used for the actual
business processes you want to test.
● The noise test performs basic load testing without an actual business process., You
tell LoadRunner the static URL you want to hit to generate ‘noise’ and LoadRunner will
create a Vuser that hits it throughout your scenario.
● Setting up Noise Testing
○ Add a new group in LoadRunner and select the ‘Use a Noise Generator…’
option, then specify the URL and the number of vusers.
○ When you run the performance test scenario each noise generator vuser will hit
the URL as frequently as it can. If you want to change the pace of how often
the URL is hit you can do this via the pacing options in the runtime settings.

Page 27/29
Best Practices: Load / Performance Testing
● Do's and Don'ts of Load Testing
● 6 Steps to Become a .Net Performance Expert
● Accelerating Your Delivery Pipeline with SmartBear and Jenkins

World Quality Report (WQR)


● Sogeti WQR 2018-19: Key Recommendations
● MicroFocus World Quality Report 2018-19
● TechBeacon: World Quality Report 2018-19: Key trends shaping QA today
● World Quality Report 2017-18 — Overview Infographic
● The 2018 State of Software Testing

Shift Left Performance Testing


● WilsonMar: Shift-Left Load Testing
○ WilsonMar: YouTube Video- Shift-Left
● Focus On Quality Earlier In The Development Process By Shifting Left With SmartBear
○ Mythbusters: Shift Left Edition for Software Testing
● NeoLoad - Load Testing Tool: How To Choose The Best For you?
● How High-Performing Teams ‘Shift Left’ with Continuous Testing
● Shift Left Performance Testing - a Different Approach

Page 28/29
Interview Section

How do you determine which piece of software requires how much testing?
We can know this factor by finding out the Cyclomatic Complexity.
● Is the feature/program testable?
● Is the feature/ program understood by everyone?
● Is the feature/program reliable enough?

Performance tuning
What is performance tuning? How many types are there?
Performance tuning is done for improving the system performance:
1. Hardware Tuning: Optimizing, adding or replacing hardware components of the
system and changes done in the infrastructure level to improve system performance is
called hardware tuning.
2. Software Tuning: Identifying the software level bottlenecks by profiling the code,
database etc. Fine tuning or modifying the software to fix the bottlenecks is called
software tuning.

Software Testing Life Cycle (STLC)

Phases of STLC
● Requirements phase
● Planning Phase
● Analysis phase
● Design Phase
● Implementation Phase
● Execution Phase
● Conclusion Phase
● Closure Phase

Page 29/29

You might also like