tag:blogger.com,1999:blog-1844881057158848702024-03-13T05:38:27.735+05:30JMeter ExpertTushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-184488105715884870.post-4059186936408536962010-04-02T17:21:00.001+05:302010-04-02T18:31:38.692+05:30First Impression About Apache JMeterWhen quality analyst gets introduced to Apache JMeter they have to struggle on many grounds. If they are used to work with commercial tools like Quick Test Pro or TestRunner then the shifting of paradigm is difficult.<br />
<br />
<br />
<div>These are some initial impressions of quality analysts about Apache JMeter:</div><br />
<ol><li>Technical jargon like test plan, Thread, workbench, controller etc is not user friendly.</li>
<li>How to create test plan? What is thread, workbench? There are so many options in Controller.</li>
<li>When compared with any other automation tool, it seems difficult. Like In QTP, Novice user can simple install QTP, Record and then run and view directly where its testing is failed. But in JMeter we cannot directly record and run. We need to first create Test Plan, add http request and then to view result we need to add listener. In short first we need to understand Jargon.</li>
<li>It seems JMeter is more of developer's tool than QA's tool. For doing functionality testing, we need write coding. Jar files, class etc.</li>
<li>Analysis of the test result is difficult. </li>
<li>Errors of JMeter are not directly displayed. It is difficult to understand where it is failed.</li>
<li>Precise and well defined help is not available.</li>
<li>Invoking JMeter is from /bin folder is not user friendly. Also command prompt opening with it.</li>
<li>Since JMeter is open source tool, we really cannot find the scope of its usage. </li>
<li>How to measure how CPU, Memory, peak memory when doing performance testing?</li>
<li>Viewing result in different formats e.g XML, requires updates in XML files which user is not aware</li>
<li>Tool support different testing like distribution, testing across different bandwidth but for this requires lot of changes in configuration file and it is not mentioned properly in Help file. <br />
<br />
<br />
</li>
</ol>Thanks for reading<br />
<br />
<div></div>with regards<br />
<div>JMeter-Expert Blog Team</div><br />
<div></div>Sujata Waghhttp://www.blogger.com/profile/13230822339342339029noreply@blogger.com1tag:blogger.com,1999:blog-184488105715884870.post-62914042425090252962010-03-29T07:38:00.005+05:302010-04-08T09:46:21.606+05:30Testing performance of web page with Apache JMeterIn last article we saw a typical workflow of a browser calling a web page and displaying it for the user. If you have not read that post please <a href="http://jmeter-expert.blogspot.com/2010/03/how-apache-jmeter-simulates-multiple.html">read it here first</a>.<br />
<br />
Topics covered in this article:<br />
<br />
<ol><li>Step by step method to test single web page in Apache JMeter</li>
<li>Manually creating a test plan in Apache JMeter</li>
<li>Simulating 50 users through Apache JMeter test plan</li>
</ol><div>Let us see what we want to achieve first. We want to create a Test Plan in Apache JMeter so that we can test performance of one web page say page shown by the URL: h<a href="ttp://www.google.com/">ttp://www.google.com/</a>. We will need many elements in the JMeter Test plan let us see what are they:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6w1u0bxX5I/AAAAAAAACQM/Nw1hDlKm8UA/s1600/final-test-plan.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="580" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6w1u0bxX5I/AAAAAAAACQM/Nw1hDlKm8UA/s640/final-test-plan.png" width="640" /></a></div><div>So this is what we shall see when we are done with creating the Test Plan. We have to start with a blank JMeter window</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6w5H3ZxzjI/AAAAAAAACQU/aUvEJup3C68/s1600/http08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="628" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6w5H3ZxzjI/AAAAAAAACQU/aUvEJup3C68/s640/http08.png" width="640" /></a></div><div>Before adding anything more to this window let us change the name of Test Plan. We can type a new name for the node in the Name text box. In this version of JMeter the name does not get reflected immediately when you type it in the text box. You have to change focus to workbench node and back to Test Plan node to see the name getting reflected.</div><div><br />
</div><div>Let us give new name "First Test" to the Test Plan node.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w5xgSZd9I/AAAAAAAACQc/veDEukuEJsI/s1600/http09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="384" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w5xgSZd9I/AAAAAAAACQc/veDEukuEJsI/s640/http09.png" width="640" /></a></div><div>Now we will add our first element in the window. We will add one Thread Group, which is placeholder for all other elements like Samplers, Controllers, Listeners. We need one so we can configure number of users to simulate. The Thread Group represents one set of actions performed by User.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w6cFfvZMI/AAAAAAAACQk/OEEyo6nmF00/s1600/http10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="476" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w6cFfvZMI/AAAAAAAACQk/OEEyo6nmF00/s640/http10.png" width="640" /></a></div><div>In JMeter all the node elements are added by using the context menu. You have to right click the element where you want to add a child element node. Then choose the appropriate option to add.</div><div><br />
</div><div>We will click the Thread Group option and it will get added under the Test Plan (First test) node.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w70rT5KEI/AAAAAAAACQs/1UASM82f0j0/s1600/threadgrp-defaults.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="508" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6w70rT5KEI/AAAAAAAACQs/1UASM82f0j0/s640/threadgrp-defaults.png" width="640" /></a></div><div>Like we changed the name of Test Plan let us also change the name of Thread Group. For us this is the element which represents multiple users. So let us name it "Users". For us this element means Users visiting the Google Home Page.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6xCEJD1l9I/AAAAAAAACQ0/DA43pnfxLaU/s1600/http11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6xCEJD1l9I/AAAAAAAACQ0/DA43pnfxLaU/s640/http11.png" width="640" /></a></div><div>Now we have to add one Sampler in our Thread Group (Users). As done earlier for adding Thread group, this time we will open the context menu of the Thread Group (Users) node by right clicking and we will add HTTP Request Sampler by choosing Add > Sampler > HTTP request option.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6xDxHKvoSI/AAAAAAAACQ8/wrDuYdTUo5g/s1600/add-sampler-menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="398" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6xDxHKvoSI/AAAAAAAACQ8/wrDuYdTUo5g/s640/add-sampler-menu.png" width="640" /></a></div><div>This will add one empty HTTP Request Sampler under the Thread Group (Users) node.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6xIHu1CETI/AAAAAAAACRE/LwzJ8RI3HQE/s1600/httpsampler-defs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="532" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6xIHu1CETI/AAAAAAAACRE/LwzJ8RI3HQE/s640/httpsampler-defs.png" width="640" /></a></div><div> We will need most configuration in this node element, HTTP Request Sampler. The settings we have to configure are:</div><div><ol><li><b>Name</b>: we will change the name to reflect the action what we want to achieve</li>
<ol><li>This will will name <b>"Visit Google Home Page"</b></li>
</ol>
<li><b>Server Name or IP</b>: here we have to type the web server name</li>
<ol><li>In out case it is <b>www.google.com</b></li>
<li>Note http:// part is not written this is only the name of the server or its IP</li>
</ol>
<li><b>Protocol</b>: we will keep this <b>blank</b></li>
<ol><li>That will mean we want HTTP as the protocol</li>
</ol>
<li><b>Path</b>: we will type path as <b>/ (slash)</b></li>
<ol><li>This means we want the root page of the server</li>
<li>This also means now the server will decide what page will be sent to us and it is the default page of the web site</li>
</ol></ol><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6xJZn4xmHI/AAAAAAAACRM/7UMRiF5u1sQ/s1600/http12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="566" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6xJZn4xmHI/AAAAAAAACRM/7UMRiF5u1sQ/s640/http12.png" width="640" /></a></div><div>After add the HTTP Request Sampler we will need one Listener. Let us add View Results Tree Listener under the Thread Group (User) node. This will ensure that the results of the Sampler will be available to view in this Listener node element.</div><div><br />
</div><div>Adding a listener is also same like adding a new node under Thread Group. Open the context menu and choose Add > Listener > View Results Tree option to add the listener.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6xP5S51g2I/AAAAAAAACRU/qWAyNzuR8Cw/s1600/view-result-menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6xP5S51g2I/AAAAAAAACRU/qWAyNzuR8Cw/s640/view-result-menu.png" width="594" /></a></div><div>With this much of setup we are now ready to run our first test. Coming back to the configuration of the Thread Group (Users) we have kept it all default values. This means JMeter will execute the sampler only once. It will be like a single user and only one time.</div><div><br />
</div><div>This is similar to like a user visiting a web page through browser, only here we are doing that through JMeter sampler. We will execute the test plan using Run > Start option.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6x0TGlV_6I/AAAAAAAACRc/V8XYJrLjckk/s1600/startmenu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="476" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6x0TGlV_6I/AAAAAAAACRc/V8XYJrLjckk/s640/startmenu.png" width="640" /></a></div><div>Apache JMeter asks us to save the test plan in a disk file before actually starting the test. This is important if we want to run the test plan again and again. If we say not to save by clicking No option it will run without saving. Let us save it first so we can reuse it again.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6_-2DnBsLI/AAAAAAAACRk/SJeoWKBxq3k/s1600/save-warning.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6_-2DnBsLI/AAAAAAAACRk/SJeoWKBxq3k/s640/save-warning.png" width="640" /></a></div><br />
We have kept the setting of the thread group as single thread (that means one user only) and loop for 1 time (that means run only one time), hence we will get result of one single transaction in the View Result Tree Listener.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AAe2jOKvI/AAAAAAAACRs/jUKBoiwd9K4/s1600/viewtree-listener.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AAe2jOKvI/AAAAAAAACRs/jUKBoiwd9K4/s640/viewtree-listener.png" width="640" /></a></div>This means JMeter was successful in fetching the web page at the given URL just like a browser. It has stored all the headers and the response sent by the web server and ready to show us the result in many ways.<br />
<br />
Let us take a closer look at the three tabs available in the View Result Tree Listener view. <br />
<br />
The first tab is Sampler Results. It shows JMeter data as well as data returned by the web server. Usually browsers hide this data from us as it is not related to showing the web page. This data is utilized internally by the browser, for example when there is a Response Code: 404 then the browser shows a page not found error page, and when the Response Code is 200 the browser shows the received web page HTML.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S7ACTHVYkwI/AAAAAAAACR0/A4noXPFKf6Q/s1600/sampler-result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="420" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S7ACTHVYkwI/AAAAAAAACR0/A4noXPFKf6Q/s640/sampler-result.png" width="640" /></a></div>The second tab is Request, where all the data which was sent to the web server as part of the request is shown.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AD1Q0AueI/AAAAAAAACR8/k4aDDtjzYl0/s1600/request.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="284" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AD1Q0AueI/AAAAAAAACR8/k4aDDtjzYl0/s640/request.png" width="640" /></a></div>The last tab is Response data. In this tab the listener shows the data received from server as it is in text format. It also have facility to show the data in XML, HTML formats but that will be just the data in other way (no JavaScript will be executed). This may look different that the page actually seen in the browser.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S7AEjSxlk7I/AAAAAAAACSE/g8mMLWJ7LJ0/s1600/response+data.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S7AEjSxlk7I/AAAAAAAACSE/g8mMLWJ7LJ0/s640/response+data.png" width="640" /></a></div><br />
We can select different ways of viewing this response data like as below:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S7AF1EEnEcI/AAAAAAAACSM/s1qqcsFjB4s/s1600/html-view.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="586" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S7AF1EEnEcI/AAAAAAAACSM/s1qqcsFjB4s/s640/html-view.png" width="640" /></a></div>This was just one request but JMeter's real strength is in sending the same request like many users are sending it. To test the web servers with multiple users we will have to change the Thread Group (Users) settings.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AJLahIdKI/AAAAAAAACSU/rL7Suu_ocvU/s1600/more-users.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="388" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S7AJLahIdKI/AAAAAAAACSU/rL7Suu_ocvU/s640/more-users.png" width="640" /></a></div>We will set 50 users and these requests will be sent with some delay of (10/50) seconds as we have set the ramp up time to 10.<br />
<br />
To visualize the results, a better aggregating listener will be required so we will add Summary Report Listener in the Thread Group node. Adding Summary Report Listener is similar to adding a View Results Tree Listener. Just right click on the Thread group node and choose Add > Listener > Summary Report.<br />
<br />
We will run the test plan again after adding the Summary Report Listener ans when the test is done we will see the following results. Your results may be different than mine due to different environments but mostly similar.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S7ALKWdE0KI/AAAAAAAACSc/eFfRazDfYTg/s1600/multisummary.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S7ALKWdE0KI/AAAAAAAACSc/eFfRazDfYTg/s640/multisummary.png" width="640" /></a></div>This is how we tried testing one single page with JMeter. The summary report shows values about the measurement JMeter has done while calling the same page as if many users are calling the page. Let us look at some of the value headings and what they mean:<br />
<br />
<ul><li><b>Samples</b>: A sample mean one sampler call. One request to web page in our case. So the value of 51 means total 51 web page requests to the page http://www.google.com were made by JMeter </li>
<li><b>Average</b>: This value is the average time taken to receive the web pages. In our case there were 51 values of receiving time which were added and divided by 51 and this value is arrived by JMeter. This value is a measure of performance of this web page. This means on an average 334 milliseconds time is required to receive this web page for our network conditions.</li>
<li><b>Min and Max</b>: These are the minimum and maximum value of time required for receiving the web page.</li>
<li><b>Std. Dev</b>: This shows how many exceptional cases were found which were deviating from the average value of the receiving time. The lesser this value more consistent the time pattern is assumed.</li>
<li><b>Error %</b>: This value indicated the percentage of error. In our case 51 calls were made and all are received successfully this means 0 error. If there are any calls not received properly they are counted as errors and the percentage of error occurrence against the actual calls made is displayed in this value.</li>
</ul>To check the performance of the web page the average value of receiving the page is an important parameter to check. <br />
The sample test plan so created in this article is available for <a href="http://www.archive.org/download/FirstTest-VisitGoogleHomePage/FirstTest-VisitGoogle.jmx">download here</a>:<a href="http://www.archive.org/download/FirstTest-VisitGoogleHomePage/FirstTest-VisitGoogle.jmx"><img border="0" height="50" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S7B6mDiAvnI/AAAAAAAACSk/3pUit9ghjno/s200/download-300x300.png" width="50" /></a><br />
<br />
NOTE: This technique of manually adding a HTTP Request Sampler is only useful in testing a single web page. This means when we visit the home page of any web site this technique works best. When we want to test a sequence of web pages, and when there involve web sites created by complex frameworks like ASP.NET, Java JSF etc then recording the sequence of web pages using HTTP Proxy component is useful. The recording of web pages sequence with HTTP Proxy component will be covered in a post very soon on this blog.<br />
<br />
Thanks for reading<br />
<br />
with regards<br />
JMeter Expert Blog Team<br />
<br />
</div></div>Tushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.com25tag:blogger.com,1999:blog-184488105715884870.post-21642425409772904122010-03-26T07:54:00.000+05:302010-03-26T07:54:22.663+05:30How Apache JMeter simulates multiple users?<div class="separator" style="clear: both; text-align: center;"></div>Topics covered in this article:<br />
<br />
<ol><li>Introduction to different elements of a JMeter Test Plan.</li>
<li>Difference between real world and JMeter world while doing a web request.</li>
<li>Workflow of a typical web server request and response.</li>
<li>JMeter's role in a web testing work flow.</li>
</ol><div>Let us take a view at how a request for web page is sent to the Web server from a User's browser, and how a web page is finally displayed. Understanding this workflow will give us opportunity to imagine how JMeter fits in this workflow and how it can do same thing as a browser does.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRWOP1cyI/AAAAAAAACO0/wwCoIh_N19Y/s1600/http01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRWOP1cyI/AAAAAAAACO0/wwCoIh_N19Y/s640/http01.png" width="640" /></a></div><div><br />
</div><div>Now introducing Apache JMeter into the picture. The actions taken by the User are no longer required. The User action trigger some HTTP requests which are recorded in a JMeter HTTP Request Sampler for multiple uses. </div><div><br />
</div><div>See how JMetr replaces a browser, but how the working is a little different.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wRYkjdjSI/AAAAAAAACO8/x52v6rRjfOY/s1600/http02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="593" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wRYkjdjSI/AAAAAAAACO8/x52v6rRjfOY/s640/http02.png" width="640" /></a></div><div><br />
</div><div>So what makes one User transaction in terms of JMeter? </div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRbp_P8YI/AAAAAAAACPE/72C8m96G1jo/s1600/http03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRbp_P8YI/AAAAAAAACPE/72C8m96G1jo/s640/http03.png" width="640" /></a></div><div>When we add a HTTP Request Sampler in JMeter Test plan it stores one Web Page calling and receiving sequence. We can call this as a single user transaction. As soon as we tell this to JMeter it is capable of doing the same thing any number of times. It also does this multiple times simultaneously.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6wReD6gMAI/AAAAAAAACPM/xQx6xqOjrWc/s1600/http04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6wReD6gMAI/AAAAAAAACPM/xQx6xqOjrWc/s640/http04.png" width="598" /></a></div><div><br />
</div><div>As JMeter is not exactly a browser the HTTP Request Sampler makes all the received data available for further analysis. We use View Tree Listener for actually visualizing the received response. View Tree Listener is a good way to know what request was sent, what was the response and the result of the transaction.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRgHXVXlI/AAAAAAAACPU/hT7XAAASAiw/s1600/http05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="550" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wRgHXVXlI/AAAAAAAACPU/hT7XAAASAiw/s640/http05.png" width="640" /></a></div><div><br />
</div><div>When JMeter simulates multiple users by making the same call multiple times, in different operating system threads (we can say execution paths) that time more analytical data is available. The Summary Report Listener can show us the additional calculated data line Minimum time and Maximum time taken to receive the response. It also calculates the average time taken using all the results together.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wRjLZvDpI/AAAAAAAACPc/sU8T091BRls/s1600/http06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="614" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wRjLZvDpI/AAAAAAAACPc/sU8T091BRls/s640/http06.png" width="640" /></a></div><div><br />
</div><div>So we have seen that for web site testing we need many items like</div><div><ol><li>HTTP Request Sampler</li>
<li>View Tree Listener</li>
<li>Summary Report Listener</li>
</ol><div>To use these items provided by JMeter we will also need items like</div><div><br />
</div><div><ol><li>Test Plan and</li>
<li>Thread Group</li>
</ol><div>For some advanced user transactions and logical conditions there are Controllers. Once we learn how to combine these elements we are ready to write our first Test Plan in JMeter.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wWn5eGCEI/AAAAAAAACPk/DVFrMq1rJ9s/s1600/http13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="618" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wWn5eGCEI/AAAAAAAACPk/DVFrMq1rJ9s/s640/http13.png" width="640" /></a></div><div>Yes initially this may seem like a lot of jargon. Eventually we will get used to these elements and then testing will be a piece of cake. Ok, let us re-visit what they all mean in JMeter world.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wXIATvtxI/AAAAAAAACPs/n-QYBvo8K7k/s1600/http14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="394" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6wXIATvtxI/AAAAAAAACPs/n-QYBvo8K7k/s640/http14.png" width="640" /></a></div><div><br />
</div><div>We will write our first Test Plan step by step in the next article but let us first get introduced formally with the different elements we have seen till now.</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6wY9OzeYxI/AAAAAAAACP0/EhvHRrjB324/s1600/http15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6wY9OzeYxI/AAAAAAAACP0/EhvHRrjB324/s400/http15.png" width="352" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wZHBQVzXI/AAAAAAAACP8/8DFr4VFLpGE/s1600/http16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://4.bp.blogspot.com/_fcQoj48LYPE/S6wZHBQVzXI/AAAAAAAACP8/8DFr4VFLpGE/s640/http16.png" width="456" /></a></div><div>Now we know some elements which will be used in creation of a Test Plan in JMeter. It will be worthwhile checking the difference between real world transactions and the transactions that happen in JMeter world. Is there one to one mapping between actions performed in real world and while executing a JMeter test plan?</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6wZ1bkJwNI/AAAAAAAACQE/QuxpZ9AUtJ8/s1600/http07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6wZ1bkJwNI/AAAAAAAACQE/QuxpZ9AUtJ8/s640/http07.png" width="446" /></a></div><div><br />
</div><div>Thats all for this article. Thanks for reading.</div><div><br />
</div><div>with regards</div><div>JMeter-Expert Blog Team</div></div></div>Tushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.com40tag:blogger.com,1999:blog-184488105715884870.post-18271184251799394892010-03-23T10:53:00.000+05:302010-03-23T10:53:00.580+05:30Short Interview with Apache JMeter<b>Quality Analyst: Hello JMeter can you tell us something about yourself?</b><br />
Apache JMeter: Hello! I am a load testing tool. If you tell me how to perform a certain action I can simulate multiple users doing that action. This is like cloning users, isn't it? I am a child of Apache Jakarta project, technically sub project of Apache Jakarta project. I was created initially to test performance of web sites, but you know what, now I help people test many more things like database performance, FTP server performance and much more. For more information you can visit <a href="http://jakarta.apache.org/jmeter/">my home page here.</a><br />
<br />
<b>Quality Analyst: We heard that sometimes you talk Java and Javascript language? Is this true, and do we Quality Analysts have to know Java or JavaScript to talk with you?</b><br />
Apache JMeter: Well, simple scenerios of testing can be done with no knowledge of JavaScript but for advanced functional testing you should know JavaScript. Java is needed only if you are using Java Sampler part of my abilities and if you want to extend my capabilities.<br />
<br />
<b>Quality Analyst: You mentioned functional testing just now, so can you also help us testing our software functionally?</b><br />
Apache JMeter: The answer is yes. I can help you test the software functionally. This requires thorough knowledge of the Sampler you are using. For example in case of web site testing HTTP Request Sampler is used so the request and response patterns of this sampler shall be known to the user. They can then write assertions on the response to check whether the response was as expected and hence functionally check the response.<br />
<br />
<b>Quality Analyst: Do you like a particular browser?</b><br />
Apache JMeter: This question is confusing. Let me clear some points first. I am not a browser. No, I am not a browser in traditional sense. Yes I can visit a web site just like a browser do (through my HTTP Request Sampler and HttpClient Sampler) but I do not show that web site on screen exactly as a browser do. My job is to visit a web site and capture the response sent by that web site. I can show you the response as TEXT, XML or even in terms of HTML but without executing any JavaScript on that page.<br />
<br />
So there is no question of me liking any browser. Browsers and I are different things. My behaviour is different than any existing browser.<br />
<br />
<b>Quality Analyst: I know that you help us record our actions and then you can play them again. My question is, are those recordings OS dependant? In other words if I record something on Linux, can I play those actions on a Windows workstation?</b><br />
Apache JMeter: Oh yes you can. I can save Test Plans for you and those test plans are in XML format so they have nothing to do with any particular OS. You can run those test plans on any OS where I can run.<br />
<br />
Thanks for your time JMeter. It was nice talking with you.<br />
<br />
with regards<br />
<a href="http://jmeter-expert.blogspot.com/2010/03/jmeter-expert-blog-team.html">JMeter-Expert Blog Team </a>Tushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.com4tag:blogger.com,1999:blog-184488105715884870.post-26372648233235279912010-03-17T14:24:00.001+05:302012-06-21T17:14:13.563+05:30JMeter-Expert Blog TeamThe JMeter-Expert Blog team is made up of following people:<br />
<br />
<a href="http://in.linkedin.com/in/tusharvjoshi"><b>Tushar Joshi</b></a><br />
Tushar is a software architect, currently working with <a href="http://www.persistentsys.com/">Persistent Systems</a>, Nagpur as an Architect. Tushar has interest in open source communities and currently leads the JUG Nagpur community. Tushar is working in software design and architecture field since 1998. <br />
<br />
<b><a href="http://in.linkedin.com/pub/sujata-wagh/2/290/92a">Sujata Wagh</a></b><br />
Sujata is a quality analyst, currently working with <a href="http://www.persistentsys.com/">Persistent Systems</a><a href="http://www.info-spectrum.com/"></a>, Nagpur as a QA Module Lead. Sujata has interest in JMeter and testing tools.Tushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.com34tag:blogger.com,1999:blog-184488105715884870.post-89997507258030187712010-03-17T14:00:00.009+05:302010-03-18T08:43:51.226+05:30Installing Apache JMeter in Windows XPThis article contains following topics:<br />
<br />
<ul><li>Prerequisites for installing Apache JMeter</li>
<li>How to install Apache JMeter?</li>
<li>How to start Apache JMeter?</li>
</ul><br />
<div><b>Prerequisites for installing Apache JMeter</b><br />
<b><br />
</b><br />
Apache JMeter is a utility based on <a href="http://www.java.com/getjava/">Java</a>. We need <a href="http://www.java.com/getjava/">Java runtime</a> already installed to use <a href="http://jakarta.apache.org/jmeter/">Apache JMeter</a>. After confirming that our Windows XP system has proper Java runtime installed we can proceed for installing Apache JMeter.<br />
<br />
For checking whether we have Java runtime installed we can follow one of the methods <a href="http://www.javatester.org/version.html">given here</a>. The second method given on that page is the easiest and that is opening a command prompt and typing the command:<br />
<br />
java -version<br />
<br />
If the command works Java is installed and you will also know the version of Java.<br />
<br />
Apache JMeter runs on a fully compliant JVM 1.4 or higher. (It is found that some early versions of Java 1.5 below update 7 do not recognize some JVM switches and hence the jmeter.bat script file needs some changes to run JMeter, described at the end of post).</div><div><br />
<b>Steps for installing Apache JMeter</b><br />
<b><br />
</b></div><div>The <a href="http://jakarta.apache.org/jmeter/">Apache JMeter Home page</a> contains links for downloads. When we visit <a href="http://jakarta.apache.org/jmeter/">Apache JMeter</a> home page the Apache Jakarta project symbol of a bird feather can be seen with introduction to JMeter. <br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CNAq2kWMI/AAAAAAAACN4/cg6JElE7jpI/s1600-h/src1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CNAq2kWMI/AAAAAAAACN4/cg6JElE7jpI/s640/src1.jpg" width="640" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"></div><br />
As shown in the image below we have to select the <a href="http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi">Download Releases link</a> from the home page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_fcQoj48LYPE/S6CM-_DEYVI/AAAAAAAACNw/4YibPS-PWxg/s1600-h/src2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://2.bp.blogspot.com/_fcQoj48LYPE/S6CM-_DEYVI/AAAAAAAACNw/4YibPS-PWxg/s640/src2.jpg" width="577" /></a></div><br />
The download page presents many options for download. Usually the suggested mirror is the best mirror but we can choose another one if the suggested mirror gives error or seems slow. For just using the tool we need only the binary release. The screen below shows the version current at the time of writing this article. The <a href="http://filext.com/file-extension/TGZ">TGZ </a>version of the binary is relatively smallest in size. Click on that link and save the download when prompted by the browser.<br />
<br />
Alternatively you can click on the <a href="http://filext.com/file-extension/ZIP">ZIP</a> version given below and use any standard UNZIP utility to extract the files. <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CM9aRVlOI/AAAAAAAACNo/LJOw1MrXz8o/s1600-h/src3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="424" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CM9aRVlOI/AAAAAAAACNo/LJOw1MrXz8o/s640/src3.jpg" width="640" /></a></div><br />
I have saved the <a href="http://filext.com/file-extension/TGZ">TGZ </a>file and extracted the contents by using <a href="http://www.7-zip.org/">7Zip utility for windows</a>. After extracting the TGZ file we get a folder named jakarta-jmeter-n.n.n, where n.n.n is the version number which we downloaded.<br />
<br />
The executable script for Apache JMeter is located in the bin directory. <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CM8Gy2T6I/AAAAAAAACNg/mA9UpPRm_7E/s1600-h/src4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="341" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CM8Gy2T6I/AAAAAAAACNg/mA9UpPRm_7E/s400/src4.jpg" width="400" /></a></div><br />
The screen below shows all the contents of the jmeter bin folder.<br />
<br />
<b>Starting Apache JMeter tool</b><br />
<b><br />
</b><br />
The executable script for Windows platform is jmeter.bat for Linux systems it will be jmeter.sh<br />
These scripts are used to start JMeter in GUI mode. Let us double click the jmeter.bat script to start the tool.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_fcQoj48LYPE/S6CMtsXaoxI/AAAAAAAACNY/G_dY4PVGXM0/s1600-h/src5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://3.bp.blogspot.com/_fcQoj48LYPE/S6CMtsXaoxI/AAAAAAAACNY/G_dY4PVGXM0/s640/src5.jpg" width="352" /></a></div><br />
Double clicking the jmeter.bat file will start one command prompt and the JMeter utility in GUI mode, as shown below. The command prompt is tied with the GUI and hence cannot be closed. If the command prompt is closed the GUI will terminate. We can keep the command prompt minimized while working with JMeter GUI. The command prompt is useful in viewing any JMeter exceptions that may occur.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CMrlJMI1I/AAAAAAAACNQ/htKs_h5TGZk/s1600-h/src6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="408" src="http://1.bp.blogspot.com/_fcQoj48LYPE/S6CMrlJMI1I/AAAAAAAACNQ/htKs_h5TGZk/s640/src6.jpg" width="640" /></a></div><br />
We saw how to download, install and start the Apache JMeter utility.<br />
<br />
NOTE: Although Apache JMeter can run on any fully compliant Java version above Java 1.4 (It is found that some early versions of Java 1.5 below update 7 do not recognize some JVM switches and hence the jmeter.bat script file needs some changes to run JMeter. If you happen to have early Java 1.5 version below update 7 then you may get error when double clicking the jmeter.bat file. The error can be fixed by commenting line "set DUMP=-XX:+HeapDumpOnOutOfMemoryError" in the jmeter.bat file. Open the jmeter.bat file by right clicking and choosing Edit option. add REM before that line and you are ready to go.<br />
<br />
Reference:<br />
1) <a href="http://jakarta.apache.org/jmeter/usermanual/get-started.html#install">http://jakarta.apache.org/jmeter/usermanual/get-started.html#install</a><br />
<br />
Thanks for reading.<br />
<br />
with regards<br />
<a href="http://jmeter-expert.blogspot.com/2010/03/jmeter-expert-blog-team.html">JMeter-Expert Blog Team</a></div>Tushar Joshihttp://www.blogger.com/profile/03931011991029693685noreply@blogger.com22