Saturday 7 April 2012

JMETER

JMETER ::: How to use JMETER for Load Testing

Hello Friends,
                     Today i am going to tell you about a new tool i used recently. That is  "JMETER" .
Before starting load testing in Jmeter let me give you a brief introduction about Jmeter.

JMeter is an performance testing tool  produced by  Apache Jakarta 
Although JMeter  focus on web applications but it may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more).
We can use it to make a graphical analysis of performance or to test our server/script/object behavior under heavy concurrent load. 
For your starting step :

As JMeter is a Java application the installation comes basically down to extracting the zip/tar.gz file.
and for starting just double click on "JMeter.Bat" file if you have java installed correctly in your system.

* If you have problem in launching JMeter just edit the JMeter.Bat replace Heap size to '512 ' to 256 .

You’ll see following screen:



 
First we add a “Thread group” to the “Test Plan” via right click onto “Test Plan” as shown in following screenshot:

 Now Click on Thread Group and add a 'Http Request Default '

 


 Now in the server Name or IP text box write the name of the web source which load you want to test. for ex : www.google.com and port let it be default.

After this we add an “HTTP Proxy Server” to the Workbench (as “Non Test Element”) to capture the traffic between your browser and the web site to test. Following screenshot shows how to add the proxy server.






Open the “HTTP Proxy Server” page and change the port if required and set the “Target Controller” to “Test Plan > Thread Group”.

Its almost done now open your browser and tell him to use your proxy server. I will tell you how
Go to Internet Options in tools menu and change the lan settings by adding your proxy server
give the address either ip of your system or "localhost" and port default (8080) .

Now go to the real fun. go to your HttpProxy Server page and click on "Start" at the bottom.

 

Now restart your browser and do some browsing on google.com  and let  the JMeter record all the HTTP requests your browser makes, so make sure you have closed all the other tabs you have open, otherwise you will get a mixture of Ad’s and AJAX requests recorded as well. After you did click through the workflow JMeter show test later you click the “Stop” Button and take a first look what JMeter has recorded for you.




Delete any request that you don’t like by right clicking onto the node and selecting “Remove”.
Now do one more thing add a  Listener which tells us what worked and what not. We use for this “View Results Tree”. This Listener is not good for later use when you want to hammer with multiple threads onto the server. you can also  choose "summary table".







Now we’re ready for our first run, the default settings are fine (in the Menu: Run > Start).





 Now see the results what you have done :



 

If you are running a big load test, remember each Listener keeps a copy of the results in memory so you might be better running a Listener > Simple Data Writer instead which writes the results out to a file. You can then read the file in later into any of the reports.

So friends enjoy with these initial steps.We will go in deep later. 

I hope it was helpful for you .....


Thanks :




















No comments:

Post a Comment

Search This Blog

Total Pageviews