Monday, March 7, 2016

What is the difference between True Client protocol and HTTP protocol?

True client protocol works based on GUI, like click and script.Where as http protocol works on http layer (request and response).Web (HTTP/HTML) protocol script consist of series of requests written in C functions.It is difficult to add customized codes in true client protocol,where as in web http/html it is pretty much easier.

It works similar to the real browser by executing the web page code, so correlation is not required .No correlation is required for the dynamic content, it is similar to the QTP scripts running in C style. If there are grid items and similar objects need to handle objects Html ID's.

True client scripts consumes lot of memory during execution. So we need more physical resources for execution


---------------------------------------------------  Inshort ----------------------------------------------------
TruClient’s main Benefits:

  • Less scripting time
  • More accurate representation of end user activity
TruClient’s main Downside:
  • Memory Intensive

Sunday, July 19, 2015

I am facing an issue in handling pop up window in IE , pop up window is not the part of DOM, and it is not getting recorded in LR.

Solution 1:

First you need to try recording script from Chrome, because in chrome it did not ask for saving file , it directly open up PDF in new tab and you can use that URL as request in LR.
Also you can take help from below Blog for file saving.


http://motevich.blogspot.in/2008/04/loadrunner-how-to-record-pdf-file.html.


By this activity , we were able to find "how much time it took to open that PDF"



Solution 2:

The complete code for downloading file to the local disk, calculate the download size and response time.

long fp,Download_Size=0;

float Download_Time=0; 
char *data; 
unsigned long prmLen;

long Download_Size=0;

//Truncate to zero length or create file for writing. 
fp = fopen("c:tempmy_file.pdf","wb");

//Set the parameter size large enough to save the data. 
web_set_max_html_param_len("200000");

//Use web_reg_save_param with the correct boundary to capture the data returned by the server.

web_reg_save_param("FILED","LB=","RB=","Search=Body",LAST);

web_url("PDF", 
..............................

.............................

.............................

LAST);

Download_Size= web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE); 
Download_Time= web_get_int_property(HTTP_INFO_DOWNLOAD_TIME);

//Get the download size. 
lr_eval_string_ext("{FILED}", strlen("{FILED}"), &data, &prmLen, 0, 0, -1);

//Write the data saved to an output file.

fwrite(data, prmLen, 1, fp);

//Close the file pointer. 
fclose(fp);

lr_output_message("Downloaded File Size is: %.2ld Bytes", Download_Size); 
lr_output_message("File Download size is: %.2ld KB", Download_Size /1024); 
lr_output_message("File Download Time is:%.2f Seconds",Download_Time / 1000);

You can use the above c script to download the .pdf/ .xls or .xlsx file.

http://www.myloadtest.com/check-pdf-files-with-loadrunner/


Alternative code--


long fp;
char *data;
unsigned long prmLen;

web_url("writings.html",
"URL=http://www.testing.com/writings.html",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);

//Truncate to zero length or create file for writing.
fp = fopen("c:\\temp\\my_file.pdf","wb");

//Set the parameter size large enough to save the data.
web_set_max_html_param_len("200000");

//Use web_reg_save_param with the correct boundary to capture the data returned by the server.
web_reg_save_param("FILED","LB=","RB=","Search=Body",LAST);

web_url("PDF",
"URL=http://www.testing.com/writings/automate.pdf",
"TargetFrame=",
"Resource=0",
"RecContentType=application/pdf",
"Referer=http://www.testing.com/writings.html",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);

//Get the download size.
lr_eval_string_ext("{FILED}", strlen("{FILED}"), &data, &prmLen, 00, -1);

//Write the data saved to an output file.
fwrite(data, prmLen, 1, fp);

//Close the file pointer.
fclose(fp);


Wednesday, December 31, 2014

Any free Performance testing tool for Desktop applications for 50+ users.

HP Loadrunner is the baseline tool for any performance engineering, it can be used for monitoring, tuning, analysis of performance test runs. 

You get 50 Vusers as license free from HP team from HP Loadrunner version 12.01. Beyond the 50 Vusers you need to pay for the license costs. Apart from this tool, I am not sure which other performance tool supports desktop application performance testing (This performance tool supports many technologies and also you can script in VB, C & Java), supports many protocols. 

HP Loadrunner is a commercial tool.

Sunday, December 7, 2014

i want to learn performance testing.So please can any one suggest me which tool is better either?



It is very important to understand the concept of Performance Testing like -What is Performance Testing, Why do we automate Performance, Understanding the server -client architecture. After,that you can move to tool like Silk Performer, Jmeter or Load runner.

Learning tool is not so difficult but understanding the concept of performance testing and its requirement is the most imp part as every time while working on tool or as a performance tester you will require the concepts.
All the tools are same in means of recording, execution, No of Virtual users, parameterization, correlation etc but the look and feel is different of each tool.

Now Talking about tools
Jmeter
If you are just learning, I'd go with Jmeter since it is free. Once you have the basic principles of Performance Testing down, then maybe look into other


Borland Silk Performer
It delivers realistic, dependable performance tests across the latest technologies by simulating loads and network speeds for web, enterprise, and mobile applications.
http://www.borland.com/products/silkperformer/

HP Loadrunner
This will give you some of the basics for how to record and correlate your application. There are lots of detailed manuals and online help.

Grinder
The Grinder is a JavaTM load testing framework that makes it easy to run a distributed test using many load injector machines. It is freely available under a BSD-style open-source license.

NeoLoad
NeoLoad is a load and performance testing software solution designed for web and mobile applications, which realistically simulates large numbers of users and analyzes your server behavior.


But I recommend that use silk performer first for better understanding then use Loadrunner and then Jmeter.

Friday, December 5, 2014

Setting for WAN test in silk performer and Load runner

Bandwidth –
In networking, bandwidth is the maximum channel capacity of a network communication path. This path is the channel connecting computing devices. In performance tests, when aspiration is to emulate test more close to real time situation, bandwidth restrictions are also taken into consideration. Modern performance test tools provide us with the feature of putting network / bandwidth related restrictions. In loadrunner, this can be done using ‘speed simulation in ‘run time settings’. In SilkPerformer, this can be done by changing ‘Internet settings’ in ‘Active profile settings’.


SilkPerformer Network Settings -


Step 1:-

Open your project and Go to the Profile

Step 2:-

Once you open your profile,On left side you can see Replay Tab,Click on that Tab


Step 3:-
Thinktime here in pics. is only for representation purpose, you can choose thinktime according to your requirement.

It's better to Select three option shown in pics.(It's upto you)
Choose thinktime in ThinkTime Box, Checked mark three option showing in the above pics.  

Step 4:- 

Truelog files should be enable for bandwidth test.If you enable Truelog files option then Truelogs file will generate,Otherwise truelogs files will not generate.

Go to Results and enable TrueLog Files

Step 5:-

Customize your bandwidth for which you want to perform bandwidth test as shown below pics.
Go to Internet, choose Custom-Bandwidth and Select your bandwidth speed

Step 6:-

Simulation we choose as REVISITING because from that we can get both types of response time i.e
Response time without caching and Response time with caching(But for that you have to make script as multiple login logout and Iteration make it as 3(Tmain - 3) )
Choose Simulation as Revisiting


LoadRunner Network Bandwidth Settings -


Step 1:-


Step 2 :-


 Step 3 :-




Bandwidth simulation can be achieved more effectively by using WAN emulators.
WAN emulation –
WAN emulation is creating a network scenario in the test environment, exactly similar to production environment (real-time, end user scenario). This can be achieved using WAN emulation tools. Popular amongst those are – WANem, Shunra, etc.
WAN emulation thus allows the performance test team to setup a transparent application gateway which can be used to simulate WAN characteristics like Network delay, Packet loss, Packet corruption, Disconnections, Packet re-ordering, Jitter, etc.

Saturday, November 29, 2014

Please explain how do we put more load on application and database servers alone with some examples?

A Simple example is when you login to gmail server it touches the application server for validating your request to see if your credentials are authorized and you are a valid user. If you are a valid user then it reaches the DB server to download your data's based upon your network connectivity speed, your mail contents would be downloaded and displayed in your browser. 

Irrespective of the domain, application and the purpose of usage by the end users we would not be in a position to explain you how the load can be generated to the server from the end users perspective in real time. 

Load to the application can be generated in many ways, it is better to generate the load by capturing a sample business scenario with user doing steps like login, create order, logout from the server. You need to do correlation, transactions, add custom codes if required, synchronization points if required, parametrization with multiple values etc run the script fine tune in vugen for 1 vuser with multiple parameter (user) values, run it in controller for multiple parameter values to make sure your load is properly hitting the server. 

At first to you need to find the critical business scenarios for the application, plot it with percentage of users for each scenarios when calculated it should be equal to 100%. WLM (Work Load Metrics) should have Business flows, No of transactions & No of Vusers for each scenarios

You should be good enough in providing think time & pacing to generate proper load in the application, pacing can be calculated by using two parameters they are No of transactions/No of vusers gives you pacing. With out deriving proper pacing you would not be able to generate proper load in to the server, with out proper think time your load to server would be indirect stress testing. No use of testing your performance of application server in that way. You have to be familiar with Run time & Recording settings of Performance Tool either open source & commercial tool. 

If you need to know whether you are generating proper load to the server you can analyze the heap & thread dump using open source & commercial monitoring/tuning tools like Jvisualvm, Jprofiler, Jconsole are used for generating heap dump, tools like jps, jstack tools etc can be used to generate thread dump. 

In case of server slowness/stuck scenario you can generate thread dump, jvm in java/clr in .net application server hang scenario you can generate the heap dump, You can also configure probe into the server to monitor more deeply into the application server/db servers to fine tune the slow moving methods, sql queries, EJB, Weblogic, Hotspots, JVM, Heap, Threads etc. You can fine tune in DB Servers for sequences, indexes, locks, sql queries, ETL, stored procedures, DWH etc. Monitoring tools like HP Diagnostics, HP Sitescope, IBM BMC, Dynatrace, CA Wily Introscope, network monitoring tools like wireshark, fiddler tools used to monitor Latency, Bandwidth. Load balancer (IP enabled, Round Robin, Least Connections), Firewall, Proxy. Overall architecture is to be understood to generate proper load & fine tune the application. 

JVM can classified as heap & non heap further heap can be classified as Eden Space, Survivor Space, Young Generation, Virtual Space I, Virtual Space II, Older Generation (Tenure), Non Heap as Permgen & Pure Native. 

To analyze deep into server to know whether you are generating proper/right amount of users load into server would help my configuring JVM in java by using app server log files 

To generate load you have to go ahead with Baseline Test (1 user load), benchmark test (15 to 20% of actual user load), Actual test run with 100% user load. This is the procedure to generate the load in to the server.

Saturday, November 22, 2014

how to handle dynamic boundaries in LoadRunner


Dealing with Dynamic Boundary Parsing


In LoadRunner , we generally hear the term Correlation(Correlation is nothing but capturing dynamic data from the server response to be used as input in further requests).



We generally deal with dynamic data remember not dynamic boundary using following in build function,modify the function as below to include the /IC flag:
.


For Ex---















But now question arises that what should we do if data boundary is dynamic??
Here is the solution for that
Suppose you have the response data as follows, where you are Capturing the string but issue is that the left boundary is always get changing every time. You get the left boundary as Head1,Head2,Head3........HeadX  and so on, where X ranges between 0 and 9, as follows:

Head1=Captured data rb
Head2=Captured data  rb
Head3=Captured data rb
——–
——–
Head9=Captured data rb

You can capture the desired string by putting the following correlation function in place, using the /DIG text flag in combination with LB:
web_reg_save_param(“DynamicCapture”, “LB/DIG=Head#\=”, “RB=rb”, LAST);

If Digits are changing case,

The corresponding place, which you expect to be dynamically filled in with a digit, should be replaced by a pound sign ( # ).
For mulitple Digit you can replace that digit with muliple #### sign,

Head123=Captured data rb
web_reg_save_param(“DynamicCapture”, “LB/IC/DIG=Head###\=”, “RB/IC=rb”, LAST);

If letters are changing case,
Modify the function as below to include the /IC flag:
web_reg_save_param(“DynamicCapture”, “LB/IC/DIG=a#b\=”, “RB/IC=rb”, LAST);

If  digit or a letter are changing case,
Modify the function to use /ALNUM instead of /DIG text flag, and use caret sign(^) instead of # :
web_reg_save_param(“DynamicCapture”, “LB/ALNUM=Head^\=”, “RB/IC=rb”, LAST);

Keep in mind two things:
1.One sign (# or ^) for each place
2.If you have a literal # or ^ sign, it will not be interpreted as a literal, if you use the corresponding flags. E.g. LB/DIG=Head# will not match “Head#”





Saturday, November 15, 2014

Can you tell what is the right value for thread peak and how you monitor thread contention?

In my opinion, there is no such thing as "right value for thread peak". It sounds a kind of "what is the right value of cars". 

Threads perform some work and use some resources for that purpose. While a thread waits for a resource being used by another thread, there is a contention for that resource. Waiting is one of thread's states, which depends on an environment in which threads are executed, i.e. POSIX threads / some virtual machine threads which don't have to be aligned with OS threads etc. 

To monitor contention you can check number of threads in specific states / time spent in specific states... but still, you need to look at the numbers within some context (e.g. CPU utilization, number of requests waiting for processing etc.)

Friday, November 14, 2014

Where and what should we check if you are getting poor response time but rest of the other performance parameters are performing well?


Poor Response time but rest parameters are performing fine

You need to focus on time measurements and to drill down the stack. But where should you start? Unfortunately, the test report does not highlight a bottleneck. 
An effective tool to troubleshoot performance of a transaction issued by a single user is a waterfall diagram thanks to its clear visualization. It displays on which requests most of the response time was spent. 
Here's the approach that we use to find bottlenecks by using waterfall diagrams in load tests. Log the entire test traffic. After the test is complete, select a single user / iteration and display its waterfall diagram. It will show bottleneck requests for this VU during a selected iteration with certain load level.

The instrumentation for this approach is built into our load testing tool, but you can generate a waterfall diagrams without it by using Fiddler, a free web debugging proxy as follows: 
1. Install Fiddler on the LR machine 
2. In LR configure proxy on port 8888. Make sure that LR traffic is captured by Fiddler 
3. In LR add a script that inserts a request header "Fiddler-Capture" for one selected VU and iteration (use web_add_header function) 
4. In Fiddler Main Menu > Rules, click Customize Rules. A script editor will open. Find OnBeforeRequest function and add the following script: 
if (oSession.oRequest.headers.Exists("Fiddler-Capture")) 

//--- Remove the header 
oSession.oRequest.headers.Remove("Fiddler-Capture"); 

else 

//---- Hide the request from the grid 
oSession.oFlags[Utils.HIDE_FLAG] = "yes"; 
}

5. Run the test. Fiddler will pass-through the entire traffic and will capture sessions with Fiddler-Capture header in the session grid. 
6. Once the test is complete, select the captured sessions in the grid and click Timeline tab that will display a waterfall diagram like this one -http://support.stresstimulus.com/display/doc37/Waterfall+Chart

To select a different VU/iteration, you need to change them in the LR script and rerun the test (our tool does not have this limitation as it stored the entire test log in the queryable database). 
After looking at the diagrams you will know what actions caused the slowness.

Firebug and HTTP Watch

There are many tools that you can use to generate a waterfall diagram of a page. Both, HTTP Watch and Firebug have it. Such tools are used to diagnose performance of a page accessed by one user. If your transaction is slow when used by a single user, then such tools are extremely helpful to pinpoint a bottleneck even without load testing. 
If however your transaction has a scalability problem and slowness is exposed only under load, then using such tools can be tricky. 

The 1st challenge is that you need to generate a waterfall diagram at a time when your server is under load. Because Firebug has no synchronization with LR, you would need to figure out yourself the load level at the moment when the waterfall diagram was created. 
The 2nd challenge is that most of such tools capable of generating a page waterfall diagram, which can be an obstacle if your transaction comprises multiple pages. 
The 3rd challenge is to make sure that the Firebug user operates in a similar environment as VUs in LR, otherwise you will compare apples and oranges. 

We addressed these challenges in our tool. Using Fiddler will also allows to generate a waterfall diagram for a VU participated in the load test so you will compare apples to apples. 
Hope this will help and good luck with your performance troubleshooting.

Wednesday, November 12, 2014

What is the difference between Iteration and Pacing?


Iteration 

Iteration is nothing but to define the script to iterate for no. of times according to the requirement. It is nothing but repeating the task for multiple times and you need to set to initiate a new user on each iteration in your run time settings which is by default.

Pacing 

Pacing is nothing but the time gap between the iterations. For eg. if you are running your script for multiple iterations, you need to specify the time gap to maintain idleness before starting the next iteration to run.



Eg : If you are running 1 user with 3 iterations and if you pacing time is 3 secs
then iteration 2 will wait for 3 secs after iteration 1 has been completed.