Loadrunner Functions

Loadrunner Functions will give you brief idea about what are the functions are available in Loadrunner in Virtual User Generator,Let's see functions one by one.

Loadrunner Functions


Virtual User Generator has below following functions.We will see each functions examples in Next posts.

1.Utility Functions
2.AJAX Click and Reference Functions
3.AMF Functions
4.Citrix Vuser Functions
5.COM Vuser Functions
6.Datavase Vuser Functions
7.DNS Functions
8.Flex Functions
9.FTP Vuser Functions
10.IMAP Functions
11.JAVA over HTTP Functions
12.Listing Directory Functions
13.Media Player Functions
14.MS Exchange Functions
15.Dot NET Functions
16.Oracle NCA Functions
17.Remote Desktop Functions
18.SAP Functions
19.WEB Vuser Functions
20.Web Services Functions - You can read Web Services Scripting
21.XML Functions
22.Silver Light Functions

With the help of above functions you can work on different platform applications and in different ways and you can verify performance testing of different platform applications.I hope you got some information about Loadrunner Functions available in Virtual User Generator(VUGEN).Thank you for reading,please share and provide your valuable comments on this topic.

Parameterization in Loadrunner examples

Welcome to parameterization in loadrunner examples ,in my previous post you learned Web Services scripting in Loadrunner,now in this post you will learn how to do parameterization for your test scripts in Virtual User Generator,in order to work with multiple test data to verify how your test scripts works correctly.

Parameterization in Loadrunner examples


Parameterization means Replacing hard coded values in the script with the test data is called Parameterization. Parameterization will helps to reduce script size & Avoid cache effect.Now let's see below example to understand clearly to perform parameterization of test script in loadrunner.

I am using Web Services script to perform parameterization to understand clearly,you can use Web Applications but while working with Web Services you will learn more knowledge.Let's see below example.

Web Service Request




Action()
{
web_service_call( "StepName=CreateFlightOrder_101",
"SOAPMethod=HPFlights_Service|FlightsServiceMethods|CreateFlightOrder",
"ResponseParam=response",
"Service=HPFlights_Service",
"ExpectedResponse=SoapResult",
"Snapshot=t1477723319.inf",
BEGIN_ARGUMENTS,
"xml:FlightOrder="
"<FlightOrder>"
"<Class>Economy</Class>"
"<CustomerName>Rajesh kumar</CustomerName>"
"<DepartureDate>2016-10-31</DepartureDate>"
"<FlightNumber>1089</FlightNumber>"
"<NumberOfTickets>1</NumberOfTickets>"
"</FlightOrder>",
END_ARGUMENTS,
BEGIN_RESULT,
"CreateFlightOrderResult/OrderNumber=Param_OrderNumber",
"CreateFlightOrderResult/TotalPrice=Param_TotalPrice",
END_RESULT,
LAST);

return 0;
}


For Above Create Flight Order request we are going to perform parameterization for Below tags/input arguments to complete test scenario for multiple iterations.

Flight Order


1.Class
2.Customer Name
3.DepartureDate
4.Flight Number
5.NumberOfTickets

"xml:FlightOrder="
"<FlightOrder>"
"<Class>Economy</Class>"
"<CustomerName>Rajesh kumar</CustomerName>"
"<DepartureDate>2016-10-31</DepartureDate>"
"<FlightNumber>1089</FlightNumber>"
"<NumberOfTickets>1</NumberOfTickets>"
"</FlightOrder>",


Why i have taken above input arguments means ,in order to create the Flight order you should require above input parameters to get response and i am taking just three records to do parameterization in loadrunner.

STEP 1:


1.Select the value i.e Economy in Class tag.
2.Right Click on Selected Value.
3.Click on Replace with Parameter - Create New Parameter.

[caption id="attachment_893" align="aligncenter" width="727"]Create New Parameter Create New Parameter[/caption]

4.Enter Parameter Name as Class_name.
5.Click on Properties button.

[caption id="attachment_894" align="aligncenter" width="542"]Create Parameter_Properties Create Parameter_Properties[/caption]

6.Parameter Properties window will open.

STEP 2:


Now we need to create CSV file for test data please follow below steps to create CSV file.

1.Click on Browse button and go to your script directory path E:\Loadrunner_Tutorials\FlightService.

[caption id="attachment_895" align="aligncenter" width="547"]Parameter Properties_FilePath Parameter Properties_FilePath[/caption]

2.Select Files of Type as All Files and Enter File name as CreateFlightOrder.csv extension.

[caption id="attachment_896" align="aligncenter" width="579"]Create Flight Order CSV file Create Flight Order CSV file[/caption]

3.Click on Open Button,now in Parameter Properties window File path will shows as csv file.
4.Click on Create Table button and Click on OK button.

[caption id="attachment_898" align="aligncenter" width="530"]Create Table Create Table[/caption]

[caption id="attachment_897" align="aligncenter" width="465"]Create Table_Column Names Create Table_Column Names[/caption]

5.Now it will create Given Parameter Name as Column name in table and selected Value as Value in Row.

STEP 3:


1.Now it's Time to Select some settings in Parameter Properties window for each columns to pick up Unique test data for each iteration.
2.Select Column name in Select Column tab - By Name as below screenshot and Select Next Row as Unique from drop down lists.

[caption id="attachment_899" align="aligncenter" width="546"]Parameter Properties_SelectColumn Parameter Properties_SelectColumn[/caption]

3.Click on Close button.
4.Click on OK button.
5.Click on No button on HP Virtual User Generator pop up.

STEP 4:


1.Now select second value i.e CustomerName tag value i.e Rajesh kumar.
2.Right Click on Selected Value.
3.Click on Replace with Parameter - Create New Parameter.
4.Enter Parameter Name as Cust_Name.
5.Click on Properties button.
6.Now Select CreateFlightOrder.csv file.
7.Click on Add Column,click on OK button.

[caption id="attachment_900" align="aligncenter" width="420"]Add Column Add Column[/caption]

8.Repeat same steps for DepartureDate,FlightNumber and NumberOfTickets,now your Parameter Properties window looks like below.

[caption id="attachment_901" align="aligncenter" width="675"]Parameter List Parameter List[/caption]

9.Click on SAVE button in VUGen window.
10.Now Test Script will looks as below with parameters.


Action()
{
lr_start_transaction("01_CreateFlight_Order");
web_service_call( "StepName=CreateFlightOrder_101",
"SOAPMethod=HPFlights_Service|FlightsServiceMethods|CreateFlightOrder",
"ResponseParam=response",
"Service=HPFlights_Service",
"ExpectedResponse=SoapResult",
"Snapshot=t1477723319.inf",
BEGIN_ARGUMENTS,
"xml:FlightOrder="
"<FlightOrder>"
"<Class>{Class_name}</Class>"
"<CustomerName>{Cust_Name}</CustomerName>"
"<DepartureDate>{Departure_Date}</DepartureDate>"
"<FlightNumber>{Flight_Number}</FlightNumber>"
"<NumberOfTickets>{No_Tickets}</NumberOfTickets>"
"</FlightOrder>",
END_ARGUMENTS,
BEGIN_RESULT,
"CreateFlightOrderResult/OrderNumber=Param_OrderNumber",
"CreateFlightOrderResult/TotalPrice=Param_TotalPrice",
END_RESULT,
LAST);
lr_end_transaction("01_CreateFlight_Order",LR_AUTO);

return 0;
}


STEP 5:


1.Now go to Test Script directory path to Edit CSV file E:\Loadrunner_Tutorials\FlightService.
2.Open Your CSV file with Notepad++ or Notepad,you can open/edit csv file data in Parameter tab of Virtual User Generator.
3.Enter your test data in csv file.Now your csv file will display as below.

[caption id="attachment_902" align="aligncenter" width="711"]Edit with Notepad Edit with Notepad[/caption]

4.Save your script in Vugen window.

STEP 6:


1.Now it's time to change settings for Run Time settings.
2.Click on Run Time Settings in Solution Explorer.

[caption id="attachment_904" align="aligncenter" width="505"]Run Time Settings Run Time Settings[/caption]

3.In Run Time settings go to Run Login
4.Enter Number of Iterations to run ,as per CSV file 3 because 3 records i have inserted in CSV file.

[caption id="attachment_905" align="aligncenter" width="533"]Run Time Settings-Run Logic Run Time Settings-Run Logic[/caption]

5.Click on OK
6.Go to Log - Select Extended Log-Select All Check Boxes.

[caption id="attachment_906" align="aligncenter" width="609"]Run Time Settings - Log Run Time Settings - Log[/caption]

7.Click on OK button.

STEP 7:


Now Save your changes and Click on RUN icon in VUGen window.Your script execute for three time because Number of Iterations is 3 with unique test data.

[caption id="attachment_892" align="aligncenter" width="195"]Run Run[/caption]

Replay Summary


[caption id="attachment_889" align="aligncenter" width="470"]Replay Summary Replay Summary[/caption]

Replay Status


[caption id="attachment_890" align="aligncenter" width="799"]Replay Status Replay Status[/caption]

Test Results


[caption id="attachment_891" align="aligncenter" width="769"]Test Results Test Results[/caption]

I hope you understood the concept of Parameterization in loadrunner with above example,please share my post and provide your valuable comments,suggestions on this post.Thank you for reading.

Web Services Scripting Using Loadrunner

Web services scripting using loadrunner tutorial gives you clear details with real time examples,in my previous post i have given prepare script for REST API in loadrunner please go through once.

What Are Web Services?

Web Services are client and server based applications which communicate on the world wide web's(WWW) and HTTP - Hyper Text Transfer Protocol.Web Services includes SOAP,REST and JSON implementations,with the help of Web Services applications communicates with another systems/applications or transfer data from one system to another system.

This blog is moved to my new WebSite,Please Read all New POSTS with REAL time examples.




Effort Estimation template for performance testing

Welcome to Loadrunner ,in this Effort Estimation template for performance testing you will learn how to create Load/Performance testing Effort Estimation for different Business scenarios.Actually what is Effort Esstimation in Software Testing,Effort Estimation nothing but testing plan for particular project or component as per available number of Employes and number of testing hours/days required to complete the testing.Let's discuss or learn with real time examples.

Effort Estimation template for performance testing


Performance Testing Effort Estimation template have different points to consider before preparing the estimation for your project or applications or Business process,some of the major factors are

1.Business process Scenario
2.What are the major projects are available right now
3.How much Employe/Resources can afford on this project(In case handling Multiple projects)
4.What are the transaction steps involved

Test Estimation Effort Template


Test Estimate Template contains different fields as below

1.Doc Ref.No
2.Business Process
3.Performance Script
4.Performance Script Details
5.No of Hours(Resource-based)

Doc Reference No


Doc Reference Number refers business process FSD or BRD or Business NFR doc number like 1.2,1.3 etc.So here it could be Doc 1.2

Business Process


Business process means one scenario like Send an email from Gmail application.In this business scenario you can find number of steps to perform to complete one transaction as below

1.Open Gmail
2.Login with valid credentials
3.It will display inbox,
4.Click Compose
5.Enter To address,cc,Subject
6.Enter Mail Body
7.Attachments etc
8.Click on Send



As per above step's you have to identify how much time it will take to create the script in Vugen.

Performance Script Details


Performance Scrip details have different various point as below

1.Vuser Script Recording - To Record scripts in Virtual User Generator for a Business Process.
2.Vuser Script Validation - Validate the script with Conditions , prepare Correlation and add functions.
3.Performance Script Enhancements - Preparing Test data for execution , Runtime Settings,Replacing dynamic values with Correlated values , Saving the values into parameter and Parameterization in the script.
4.Vuser Script Execution - Execution of Business process Script in VUGen to verify the script.
5.Loadrunner Controller Scenario - Preparing real world mimic scenario for prepared Business process Script as below details.
1.Number of virtual users to use.
2.Number of virtual users to initiate with how many seconds.
3.Number of Hours to Run the script.
4.How to stop the VUsers at a time or slowly means 2 or 5 or 6 etc.
6.Scenario Execution - After creating or preparing the scenario in Controller run your scenario by starting the Load Generator in order to verify how many transactions are pass/fail or contains errors while running the scripts.
7.Analysis Reports - Analyze the reports with the help of Analysis component in Loadrunner to check what are the bottlenecks,how many transactions are pass/fail and HTTP status code etc points you can verify in Analysis.

For each and every step should have no of hours in the testing estimation sheet as below screenshot and at last we are calculating the total hours to required to complete the Business process and send it for approval.Once approval received from respective manager then resource will start preparing Scripts for Business scenarios.

You can prepare Effort Estimation as below ,please check screen-shot.

[caption id="attachment_840" align="aligncenter" width="647"]Effort Estimation template for performance testing Effort Estimation template for performance testing[/caption]

What have you learned?


1.What is Business Process
2.What is Test Effort Estimation
3.Factors should be consider
4.Testing Estimation Template details
5.How to prepare Performance Testing Estimation based on Performance Scripts for a Business Process.

Please share this post in case you like and got good knowledge on this topic.

Calculate Vusers for load testing

In this How to Calculate Vusers for load testing,you will learn calculate virtual users for your load testing or stress testing in order to achieve results which mimics real world.

What is load testing?


Load testing is describes how your application behaves for a given load at peak hours as well as how much time it will take to provide response for a particular request to verify your application speed,performance of the application.Load testing can be done with JMeter(Learn JMeter) or any other open source tool but in open source tool you can't run with more VUsers to check behavior of your applications.

Calculate Vusers for load testing


You can calculate number of vusers required for load testing with a basic formula as below

No of Vusers = TPS * (Response Time + Think Time)
TPS – Transactions per Second

Now here you can't simply provide 50,70,100,250,500 etc VUsers to test load on your applications,above requirements are given by the clients in below formats,then you have to calculate based on client requirements.

Business NFR:


Business NFR contains business requirements about application under test,in order to verify application performance with load testing.

Details:


Details will contain test scenarios.

Example : Verify Bank account details.

Business Rules:


Business rules contains actual results as per 3 months old data or 6 months old data with the help of analytic,Business Remarks gives below details about application(AUT).

Number of Transactions per Seconds : 600
Average Response Time : 3 sec
Think Time : 3 sec

So now it is easy to calculate number of virtual users required for a test scenario as below
Number of Virtual Users = 200*(2+1)
Number Of Virtual Users = 200*3
Number of Virtual Users = 600

So required virtual users for your test scenario is 600 VUsers for peak loads,some time users will vary may be less or more but in peak time users will increase suppose example as Festival time most of the companies running promotions on their applications to attract new users at that time number of users automatically increase,this is called peak load time.

New Features in LoadRunner 12.53

HP Loadrunner 12.53 version is released and below are the New Features in LoadRunner 12.53 are added,please find the details,also read LoadRunner tutorials for good knowledge.LoadRunner releases 11.01,11.02 to 11.50.12.02,12.50 and 12.53.

New Features in LoadRunner 12.53


Git integration in VuGen
Web - HTTP/HTML and Mobile Application - HTTP/HTML protocol unification
Linux load generator improvements
New PCoIP (remote access) protocol
Enhanced SAPUI5 recording in TruClient
REST step-builder editor in VuGen
JSON manipulation APIs
HTTP Video Streaming (HTML5, HLS) support
HTTP/2 support
Enhancements to Java-based protocols
64-bit replay support in various Java protocols and C Vuser protocol
Added in 12.53 Patch 2: Support for NV Insights
New Supported Technologies and Platforms
VuGen Enhancements
TruClient Enhancements
Virtual Table Server (VTS) Enhancements
General Protocol Enhancements
Controller Enhancements
Analysis Enhancements
Help Center Enhancements
Security Enhancements
Installation Enhancements
Integrations with the latest HPE product versions

New Technologies


Windows 10
Microsoft Edge browser
Visual Studio 2013 add-in
Visual Studio 2015 add-in
Upgraded Eclipse IDE add-in
SUSE Linux Enterprise Server 12
Red Hat Enterprise Linux 7.2
hLinux.

TruClient Enhancements


Loadrunner 12.50 supports Chromium 46 ,Firefox 40.0.3 and Internet Explorer 10 and 11 ,9 is not supported.
New End Events,Automatic End Event in Browser.
Enhancements Automatic Object Identification.
Enhancements in Control actions during recording the script.

Loadrunner 12.50 enhanced in some of the Protocols those are Citrix,C Vuser , Flex ,FTP , Java Protocol,Oracle 2-Tier,SAPGUI,Web – HTTP/HTML and last WebServices.Enhanced Analysis web GUI and provided good look in HTML reports.Loadrunner 12.50 integrated with some of the following products for better performance testing ,those are

Service Virtualization: Support for Windows 10
Diagnostics
Network Virtualization
Unified Functional Testing
Application Lifecycle Management
Performance Center
Business Process Monitor
Jenkins

Please see the complete list of enhancements in HP Site.

lr_xml_find function example

In this lr_xml_find function example you will learn how to use lr_xml_find in LoadRunner Vugen script.The lr_xml_find function verifies that whether XML values return by the server which will contains a specified query or not,simply lr_xml_find verifies the XML values with the help of XML Query.


lr_xml_find function example,Please read All REAL TIME EXAMPLES OF LOADRUNNER HERE