Loadrunner Actions

Loadrunner Actions,Three types of Actions in Loadrunner that is vuser_int,Action,vuser_end actions,Main execution load script will written in Action window and remaining vuser_int,vuser_end actions useful in one time script execution.

Loadrunner Actions

Loadrunner Actions

Loadrunner Actions  or Vuser script files are divided into three sections those are and these Actions are useful in scripting in VUgen as above Screen shot.

1. Vuser_init
2. Actions
3. vuser_end

Vuser_init:

Below are the task perform by the Vuser_init() action in Loadrunner

1. Vuser_init is the first Action executed in virtual user Generator in case you write any test script.
2. Vuser_init action saves in vuser_init.c extension.
3. Vuser_init test script executes only one time in entire Virtual User Life Cycle.
4. If you want to run for multiple set of data then you have to use Parameterization Testing process.
5. In case using Vuser_init action script then it is useful in one time initiation for Examples : Login to system

Action:

1.Action is the main section where you have to perform user actions with the help of recording or manual scripting.
2.Action file also saves in c extension,you can rename Action to your desired script name.
3.You can correlate,perform parameterization testing in Action test scripts with the help of multiple set of data.
4.You can insert Blocks in Actions using Run Time Settings.

Vuser_end:

Below are the task perform by the Vuser_init() action in Loadrunner,those are

1. Vuser_end file saves in c extension as vuser_end.c
2. Here Vuser will end their actions for example Logout of system.
3. Vuser_end action means end of Vuser life cycle execution.

Please provide your valuable comments on this Post in case you like it and got enough knowledge on Loadrunner Actions.Thank you for reading my Loadrunner Tutorials website.

Existing Stopped From Running in Loadrunner

Existing Stopped From Running in Loadrunner,While working with Loadrunner Controller you will face some of the problems like this type of issues.You will not able to identify why error is displaying while running scripts in Loadrunner Controller with load generators.

Existing stopped from running in loadrunner
EXISTING STOPPED FROM RUNNING IN LOADRUNNER

Also Read:

Loadrunner REST API testing.
lr_xml_find examples.
Design Goal oriented Scenario- Controller
Loadrunner Actions

Existing Stopped From Running in Loadrunner

You will face this type of issues in Loadrunner Controller because of below activities,those are

1.Using Loadrunner old versions.
2.HP UFT is installed after installing HP Loadrunner.
3.Installing HP Loadrunner after installing HP UFT.
4.Hp Loadrunner and HP UFT versions are not matching like UFT 11.50 and Loadrunner 12.50.
5.Your C drive space is very less.

Solution to Resolve:

I have faced this type of problems while working with Loadrunner Controller for Web-services Scripting ,not able to identify what is the issue actually,while running scripts all the Vusers are not getting stopped and not able to stop the Vusers manually because Stop button is in disable mode.All the Vuser are stopped under Existing Status but still script is executing in case Duration is completed i.e Specified Time is completed ex:10 minutes.

Note : While You are facing this type of issues,immediately you need to check your C drive 
space,if you want to run your script perfectly with out any problems in Controller then your 
C drive should have above 1 GB space.

In this situation when i trying to open Analysis controller giving error message as Not enough space in C with some path,then i understood ,immediately i have deleted some unimportant software's and deleted unimportant files in C drive then My disk space is becomes 2 GB,Then i have restarted the Scenario in Controller,it's a miracle it was working fine with out any error messages,alerts etc.

Thank you for Reading ,please share this post in social media so that many people can read and get solution for "Existing Stopped From Running in Loadrunner".Please provide your valuable comments on this post.

warning The string with parameter delimiters is not a parameter

warning The string with parameter delimiters is not a parameter in loadrunner while executing the virtual user scripts for web-services with parameterization. I have created the script for web services and executed with out parameterization then it was working fine,when i execute the test script with parameter values then in Results summary execution showing error message as "warning: The string 'xxxxxx' with parameter delimiters is not a parameter."

warning The string with parameter delimiters is not a parameter

In order to resolve this type of errors in loadrunner scripts,you have to follow below steps.

1.After creation of your script should execute with out parameterization values like {results_one}.
2.While creating parameterization values syntax should be as expected as "{parameter value}".
3.Modify Loadrunner Run time Settings as per iterations.
4.Verify duplicate parameter name for multiple different values.

Resolution:

When i am facing this problem simply i have recorded the script in another action and created new parameter names with separate csv file ,then miracle it is working or  test execution is working fine.That is the reason we have check our script first then we can go for search.

Also Read:

lr_xml_find examples
Loadrunner Actions
Create a script for REST API
Design Goal Oriented Scenarios
Loadrunner Web Services Scripting

Transactions in Loadrunner

Transactions in Loadrunner is classified into two types start and End transactions which is useful in identifying the response time taken for particular iterations or particular Actions for VUGen scripts. In my previous post you have learn web services scripting and Rest API scripting with examples,please read once for more information.

MY BLOG POSTS HAS BEEN MOVED TO NEW WEBSITE,PLEASE VISIT LOADRUNNER TUTORIALS WITH REAL TIME EXAMPLES


Thank you for reading,pleases share this post with different social media so that many people will get knowledge.

REST API Services Testing using loadrunner

REST API Services Testing using loadrunner,rest api services uses web http/html protocol while creating REST API Services scripts using virtual user generator,which is a loadrunner component.Most of the companies are using REST API services in order provide better security in customer data,fast execution for communication between
multiple applications.

Please read Complete Loadrunner Tutorial

[embed]https://youtu.be/jYlUPEC1WfE[/embed]

REST API Services Testing using loadrunner


In this post we will create REST API Services script in Virtual User Generator i.e VUGen,Please follow below steps to create script for REST API services using VUgen.

Steps:


1.REST API URL
2.Which Protocol should use
3.What is the input parameters
4.What is the output Response
5.Content- Type
6.Method - GET,POST,DELETE etc.

Once you know all above details then it is easy to create the script with the help of below simple syntax ,plesae use below syntax for all rest api services for load testing.
web_custom_request("Card_validation",
"URL=http://ipaddress:portno/cardApi/api1/card/linkcard",
"Method=POST",
"Resource=0",
"EncType=application/json",
"Mode=HTTP",
"Body="Body={\"cardNo\":\"9898989898989898\",\"cardType\":\"CreditCard\",\"MobileNo\":\"1111111111\"}",
LAST);

CODE Explanation:


As you see above code i have used web_custom_request() function which is allow users to create custom HTTP request with any useful method(POST,GET,DELETE etc)

1.Card_validation : Request Name

List of Resources:


URL
Method
Resource
EncType
Mode
Body

Method=POST:


As based on above resources we will create REST API Services scripting as you see "Method=POST" which is posting the values to database,in case you want to get the details from the database then you can use "Method=GET".

EncType=application/json:


As i have used application/json because content-Type of REST API service is developed with Media Type,as REST API Services has below Media Types,those are

1.application/json
2.application/xml
3.text/xml
4.multipart/form-data
5.multipart/mixed

Most of the REST API services are developed with application/json,application/xml and text/xml media types,this one provided by developer.

Mode=HTTP:


As i mention in first paragraph REST API service is developed with HTTP protocol for data transfering to multiple systems.While creating the REST API script you need to select
Web-HTTP/HTML protocol.

Body:


Body resource which contains input request parameters as i written in above script.The main rest api input request is as below
{
"cardNo":"9898989898989898",
"cardType":"CreditCard",
"MobileNo":"1111111111"
}

You can write above input request into below code in order to mention in Body resource.Please check below code.
"Body={\"cardNo\":\"9898989898989898\",\"cardType\":\"CreditCard\",\"MobileNo\":\"1111111111\"}"

LAST:


LAST argument which tells a market which indicates the end of the field list.This total web_custom_request() function returns LR_FAIL(1) or LR_PASS(0) on successful and on failure of web_custom_request()
function execution.

Parameterization:


We can perform Parameterization for input parameters as we mention in Body ,Please read Correlation in loadrunner post,you will get clear idea about manual and automatic correlation for any script whether it could be a web request,rest api or Web-Services.

Thank you for reading,i hope you got good knowledge about REST API Services Testing using loadrunner,please provide your valuable comments and suggestions on this post.

Extrares in Loadrunner

Extrares in Loadrunner which generates while recording WEB-HTTP/HTML protocol applications i.e web applications. Extrares records all available resources for each and every particular web url for example http://www.wikishown.com. We will see Extrares with examples and how it impact the response time of your web applications.

Extrares in Loadrunner


What is Extrares in Loadrunner,While generating or recording the test scripts in VUGen (Virtual User Generator) records each and every web url and in order to load that particular url it will check what are the extra files are associated with particular web url. As Extrares loads see below recorded code for more information.
web_url("wikishown", 
"URL=http://www.wikishown.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t8.inf",
"Mode=HTML",
EXTRARES,
"Url=images/bb_h_img2.jpg", ENDITEM,
"Url=images/bb_h_img1.jpg", ENDITEM,
"Url=images/bb_h_img3.jpg", ENDITEM,
"Url=images/loadingAnimation.gif", ENDITEM,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);

EXTRARES recording all available images,java-script,j query, css files before loading the particular URL or pages in Virtual User Generator and while executing the Action first of all it will load all available resources i.e images,css etc files then it move to next step for execution,Here you will face problems for downloading resources because some time VUGen takes more time ,some time takes less times.

What should do in case Timeout for downloading resources


You can take below following below steps in order to overcome the problems,those are

1.Comment the EXTRARES in the script.
2.Increase Step download Timeout(Sec).
3.You can use web_set_timeout() function.

In case EXTRARES are commented while executing the Test script then it is not possible to estimate or calculate average response time for application transactions.It will look like below with comments.As per below script EXTRARES will not load and it will execute the step successfully.
web_url("wikishown", 
"URL=http://www.wikishown.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t8.inf",
"Mode=HTML",
/*EXTRARES,
"Url=images/bb_h_img2.jpg", ENDITEM,
"Url=images/bb_h_img1.jpg", ENDITEM,
"Url=images/bb_h_img3.jpg", ENDITEM,
"Url=images/loadingAnimation.gif", ENDITEM,
"Url=../favicon.ico", "Referer=", ENDITEM, */
LAST);

Step Download Timeout


Step download Timeout is one of the run time setting menu under Internet Protocols,please read Step Download Timeout(Sec) post for more details.Coming to third point you can use web_set_timeout("STEP","") function to increase the timeout before web_url() in order to specify more time for downloading available resources.The script looks like below with web_set_timeout().
web_set_timeout("STEP","60");
web_url("wikishown",
"URL=http://www.wikishown.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t8.inf",
"Mode=HTML",
/*EXTRARES,
"Url=images/bb_h_img2.jpg", ENDITEM,
"Url=images/bb_h_img1.jpg", ENDITEM,
"Url=images/bb_h_img3.jpg", ENDITEM,
"Url=images/loadingAnimation.gif", ENDITEM,
"Url=../favicon.ico", "Referer=", ENDITEM, */
LAST);

Let's understand the line web_set_timeout("STEP","60") ,here STEP indicates Time–out on each VuGen step ,indicates on which step timeout should apply.
STEP - indicates on which step timeout should apply
60 - Indicates how many seconds.

I hope you got good information on Extrares in Loadrunner,in case you like my post please provide your valuable comments and suggestions.Thank you for reading my website.

Error: -27751: Step download timeout (120 seconds) has expired

Error: -27751: Step download timeout 120 seconds has expired downloading resource,While working with HTTP/HTML protocols or web applications you will face some problems while executing the test scripts in loadrunner - VUGen component.The following error message gives you when web_set_url(url name) downloading the required resources which could be as follow,those are declare or recorded in EXTRARES as below

Error: -27751: Step download timeout 120 seconds has expired


web_url("bigbazaar", 
"URL=http://wikishown.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t8.inf",
"Mode=HTML",
EXTRARES,
"Url=images/bb_h_img2.jpg", ENDITEM,
"Url=images/bb_h_img1.jpg", ENDITEM,
"Url=images/bb_h_img3.jpg", ENDITEM,
"Url=images/loadingAnimation.gif", ENDITEM,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);

In order to execute web_url() successfully Virtual User generator first downloads EXTRARES and it start execute the web_url() function ,in case downloading time completed as per setting then you will error message in reply log as

Error: -27751: Step download timeout (120 seconds) has expired when downloading resource

Resource downloading default time is 120 seconds,you can change resource downloading settings in Run time settings,please follow below steps to change resource
downloading time settings.

STEP 1 : Open Run Time Settings.
STEP 2 : Go to Internet Protocol - Preferences.

[caption id="attachment_1020" align="aligncenter" width="561"]Error: -27751: Step download timeout (120 seconds) has expired Preferences Options[/caption]

STEP 3 : Click on Options button on preferences window.
STEP 4 : Just scroll down to General - Step Download Timeout (secs) here default time is 120 seconds.You can change it to your desired value.
STEP 5 :Click on OK and again Click on OK button

In case you want to set timeout value in script itself then you can use web_set_timeout() function to increase time limit in script for downloading resources as below

web_set_timeout()


The function which works to wait until given time to CONNECT,RECEIVE OR STEP to complete particular action.
web_set_timeout("STEP","60");

After setting the time increased limit,now try to run your script in VUGen ,you will not face any problems while downloading the resources and test script will run successfully with out any problem.Please provide your valuable comments on this posts, so that i will know that you got solution.

PREVIOUS TOPIC

lr_xml_extract example

lr_xml_extract function extract particular value or total XML details from a String,lr_xml_extract example provides complete real time examples to work with different load testing scripts in your real time projects.

Loadrunner Articles: LR_XML_FIND function Examples

What is lr_xml_extract?


lr_xml_extract function extract or retrieve the value from a XML which could be input parameters or it could be XML response/Results.We can say this function extract the XML pieces you can say particular data from a String.In this post i am taking SOAP web-services example to extract value from a XML why because web services are designed in the form of XML form.

Syntax


lr_xml_extract([<XML input string>] ,[<XML Parameter>] ,[<XML Query>],[LAST]);

Example:


lr_xml_extract("XML={CreateFlightOrder_101}","XMLFragmentParam=Result","Query=CreateFlightOrderResult/TotalPrice",LAST)

1.XML Input String: It is the string indicates from which XML fragments results or input parameters should take or identify.
Example : XML={CreateFlightOrder_101}

2.XML parameters: In this specifications we are going to save the results as per Query i.e XMLFragmentParam=Result,Here i am saving XML query results into Result parameter and displaying those string values with the help of lr_output_message function.

3.XML Query : It is very important to write the query for XML fragment whether this could be for Input parameter or it could be for XML response.You can write XML Query as per your requirement ,most of the time we are writing the query in order to verify the value in XML Response to validate the same.
Example : Query=CreateFlightOrderResult/TotalPrice

4.LAST : lAST it is giving two results one is if Query is satisfied then it will give you the results as PASS from LR_PASS and in case XML Query is not satisfied then it will give you results as FAIL from LR_FAIL.

lr_xml_extract example


Please understand below example ,here i am using Web Services Scripting,in case you want to learn Web Services Scripting please read my article.Let's see the below example.

Create Flight Order Request:


Below are the SOAP Web Services XML Requests and Response.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hp="HP.SOAQ.SampleApp">
<soapenv:Header/>
<soapenv:Body>
<hp:CreateFlightOrder>
<hp:FlightOrder>
<hp:Class>Economy</hp:Class>
<hp:CustomerName>Rajesh Kuchana</hp:CustomerName>
<hp:DepartureDate>2016-12-17</hp:DepartureDate>
<hp:FlightNumber>1089</hp:FlightNumber>
<hp:NumberOfTickets>1</hp:NumberOfTickets>
</hp:FlightOrder>
</hp:CreateFlightOrder>
</soapenv:Body>
</soapenv:Envelope>

Create Flight Order Response


<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateFlightOrderResponse xmlns="HP.SOAQ.SampleApp">
<CreateFlightOrderResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<OrderNumber>50</OrderNumber>
<TotalPrice>196</TotalPrice>
</CreateFlightOrderResult>
</CreateFlightOrderResponse>
</s:Body>
</s:Envelope>

Now if you want to extract <TotalPrice>196</TotalPrice> then you can write XML Query as below
Query=CreateFlightOrderResult/TotalPrice

CreateFlightOrderResult : Starting opening tag under this tag TotalPrice value is displaying
TotalPrice : This is the value we want to extract from XML response.

You can write for other value i.e <OrderNumber>50</OrderNumber>
Query=CreateFlightOrderResult/OrderNumber

Then it will print the results as <OrderNumber>50</OrderNumber>

Loadrunner Web-Services Script:


I have recorded this script with the help of WebServices protocols and as per above XML Query path prepared lr_xml_extract function.
Action()
{
lr_start_transaction("01_CreateFlightOrder");
web_service_call("StepName=CreateFlightOrder_101",
"SOAPMethod=HPFlights_Service|FlightsServiceMethods|CreateFlightOrder",
"ResponseParam=response",
"Service=HPFlights_Service",
"ExpectedResponse=SoapResult",
"Snapshot=t1477884670.inf",
BEGIN_ARGUMENTS,
"xml:FlightOrder="
"<FlightOrder>"
"<Class>Economy</Class>"
"<CustomerName>Rajesh Kuchana</CustomerName>"
"<DepartureDate>2016-12-17</DepartureDate>"
"<FlightNumber>1089</FlightNumber>"
"<NumberOfTickets>1</NumberOfTickets>"
"</FlightOrder>",
END_ARGUMENTS,
BEGIN_RESULT,
"CreateFlightOrderResult/OrderNumber=Param_OrderNumber",
"CreateFlightOrderResult/TotalPrice=Param_TotalPrice",
END_RESULT,
LAST);

//Extract the value using lr_xml_extract function
lr_xml_extract("XML={CreateFlightOrder_101_Response}",
"Query=CreateFlightOrderResult/TotalPrice","XMLFragmentParam=Result",LAST);

//Print the Results with the help of lr_output_message() function
lr_output_message(lr_eval_string("Extracted Value is :-{Result}"));

lr_end_transaction("01_CreateFlightOrder",LR_AUTO);

return 0;
}

Once you run above script VuGen displays all your each and every step details in ReplyLog and XML Response,lr_xml_extract function results as below.

Output:


Action.c(4): Notify: Saving Parameter "CreateFlightOrder_101_Response = <CreateFlightOrder><CreateFlightOrderResult><OrderNumber>54</OrderNumber><TotalPrice>196</TotalPrice></CreateFlightOrderResult></CreateFlightOrder>".
Action.c(4): Notify: Saving Parameter "response = <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><CreateFlightOrderResponse xmlns="HP.SOAQ.SampleApp"><CreateFlightOrderResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><OrderNumber>54</OrderNumber><TotalPrice>196</TotalPrice></CreateFlightOrderResult></CreateFlightOrderResponse></s:Body></s:Envelope>".
Action.c(4): Notify: Saving Parameter "Param_OrderNumber = 54".
Action.c(4): Notify: Saving Parameter "Param_TotalPrice = 196".
Action.c(4): Web service call "CreateFlightOrder_101" was successful
Action.c(30): Notify: Parameter Substitution: parameter "CreateFlightOrder_101_Response" = "<CreateFlightOrder><CreateFlightOrderResult><OrderNumber>54</OrderNumber><TotalPrice>196</TotalPrice></CreateFlightOrderResult></CreateFlightOrder>"
Action.c(30): Notify: Saving Parameter "Result = <TotalPrice>196</TotalPrice>".
Action.c(30): "lr_xml_extract" succeeded, 1 match processed
Action.c(32): Notify: Parameter Substitution: parameter "Result" = "<TotalPrice>196</TotalPrice>"
Action.c(32): Extracted Value is :-<TotalPrice>196</TotalPrice>
Action.c(34): Notify: Transaction "01_CreateFlightOrder" ended with "Pass" status (Duration: 1.8496 Wasted Time: 0.3214).

[caption id="attachment_995" align="aligncenter" width="569"]Reply Summary Reply Summary[/caption]

What have you Learned?


1.What is lr_xml_extract function
2.lr_xml_extract example
3.How to extract value using lr_xml_extract
4.How to print output message using lr_output_message.

Please provide your valuable comments on this post and as well as provide your suggestions,in case you like my post please share it to different social networking sites.

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


Loadrunner Runtime Settings

Most important settings in VuGen is Loarunner Runtime Settings which is very useful in preparing the scenarios and for vugen scripting execution.While running the script these Runtime settings should be proper in order to execute the script as requirement for examples

Loadrunner Runtime Settings

1.Running the script for Multiple users.
2.Running the script with think time.
3.Running the script with / out proxy set up.
4.Running the script with extended log to see in details response etc.

Runtime Settings has below lists

In General there are 6 components those are

1.Run Logic :

Run Logic configure the number of iterations to repeat the same action by each Vuser.
>Main : This iterations repeats the user actions with the given number of times.Here Iterations are applicable only for action methods where scripting is prepared.
>Block: It defines the Block iterations to repeat each user action with different number of times.Please find the screen shot below.

loadrunner runtime settings

2.Pacing:

Pacing in Runtime settings is a virtual user waiting time between the iteration executions as below

1.As soon as the previous iteration ends
2.After the previous iteration ends – with a "fixed/random" delay of seconds.
3.At "fixed/random" intervals, every – seconds.Please see below screen shot for clear idea.

3.Log:

In order to check the execution log for response data we will use Log menu and it captures the behavior of the script execution.

Log menu has below sub Options:
Send Messages only when an error occurs.
Load runner will display messages in log only when error occurs in script execution.
Always Send Messages.
Always send messages option has two options those are
A.Standard Log :Standard log display default log for script execution.
B.Extended Log:Extended Log display the script execution as per below selected option those are

1.Parameter Substitution :

Log displays with each parameter substitution ,it is useful when we are doing parameterization testing.It will show each script response,for each parameter substitution like for 50 users it displays all 50 iteration script response in log in details.

2.Data returned by server : It displays only the data which is return by the server to Vusers ,sometime it display server connections also.
3.Advanced trace : It display all the vuser messages and function calls in case we are using any functions in scripts like examples

1.lr_start_transaction("User_Login")
2.lr_end_transaction("User_Login",LR_AUTO)
3.lr_error_message()
4.lr_output_message("User Login is successful")

Please see below screenshot.

loadrunner runtime settins


4.Think Time:

Think Time defines as It is a user waiting time between the transaction executions in the script.
For example
1.User login to application and waits some time to display my account screen.
2.Compose emails and verifying the message body with some time before sending.
3.Online Transactions.

Think Time has below options

a.Ignore Think Time
b.Replay Think Time

1.As Recorded
2.Multiply recorded think time by: --
3.Use random percentage of recorder think time:Min: -- %,Max: -- %
4.Limit think time to – seconds. Please see below screenshot.

Most of the time we will choose Replay Think Time As Recorded option in Runtime Settings foe script.

5.Additional attributes:

It is useful in reading value from run-time settings and which is helpful in pass value into script using run time settings.Declare argument name and value here and we can use those values into script and save the value into string using lr_save_string() and lr_get_attrib_string() functions.

6.Miscellaneous:

In this menu we are having 7 options those are

Error Handling:

1.Continue On Error : as name indicates script will execute in case error occurs while execution.
2.Fail open transactions on lr_error_message : It will fail all open transactions once the function lr_error_message is called by the user in the transactions.
3.Generate snapshot on error:It will generate snapshot of error while script execution at Runtime and display in snapshot menu.Always we has to check/select Generate Snapshot on error to capture error pages at Runtime.

Multi Threading:

1.Run Vuser as a process:
a.It is useful in running each vuser as a complete process.
b.For each Vuser it creates a separate driver program in the load generator.
c.It occupies more system resources in load generator as it created a separate driver program. (For each Vuser mdrv.exe)

2.Run Vuser as a thread

a.For all the Vusers, it creates a single driver program in the load generator.
b.Occupies less system resources as it is using a single driver program for all the Vusers (mdrv.exe)

Automatic Transaction:

1.Defines each action as a transaction (Always disable this)
2.Defines each step as a transaction.

7.Network:

The name indicates setting of Network speed as use maximum Bandwidth , Use bandwidth which is starting from kbps,Use custom bandwidth where user can provide specified band width speed for script execution.

8.Browser

Browser Emulation:In Browser Emulation can do all the browser level enhancements.

1.Simulate Browser Cache
2.Simulate a new user on each iteration :Whenever we not require to reuse the browser cache, Enable Simulate a new user on each iteration and by clearing the existing cache on each iteration.

Browser Properties are

1.Simulate Browser Cache
2.Download non-HTML Resources
3.Simulate a new user on each iteration

9.Internet Protocol

Internet protocol has below options,

Proxy : While execution of some scripts it requires proper proxy setting for example outside of the network applications in corporate offices.For outside network applications, it is mandatory to have proxy settings to access the links.At that time we will go for proxy settings and proxy has below options

1.No Proxy(Direct Connection to the Internet)
2.Obtain the proxy settings from default browser i.e IE,Chrome etc
3.Use Custom Proxy :Here we can provide our custom proxy details like Port Number and Ip address(Host address.)
1.For the LAN (Load Generators and Servers are residing on the same network) based performance testing, it is recommended to use No Proxy.
2.For WAN based OR Internet-based (Load Generators and Servers are residing on different network) Performance Testing, it is recommended to use Obtain the proxy settings from the default browser.

10.Preferences:

Preferences in LoadRunner provides details about

1.Enable Image and Text Check
2.Generate Web Performance Report Generation which contains Hits per second, Page per second and Response bytes per second.
3.Advanced Download Files Content Check

In Case like this article please provide your valuable comments and suggestions.Thank you for reading.