Showing posts with label loadrunner functions. Show all posts
Showing posts with label loadrunner functions. Show all posts

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.

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