You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by kh...@apache.org on 2001/11/13 14:29:32 UTC

cvs commit: jakarta-jmeter/xdocs/usermanual build-web-test-plan.xml

khammond    01/11/13 05:29:32

  Modified:    xdocs/usermanual build-web-test-plan.xml
  Log:
  Second draft completed.  To do: 1) Add URL's for the HTML links.
  
  Revision  Changes    Path
  1.2       +223 -0    jakarta-jmeter/xdocs/usermanual/build-web-test-plan.xml
  
  Index: build-web-test-plan.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/build-web-test-plan.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-web-test-plan.xml	2001/10/28 13:22:50	1.1
  +++ build-web-test-plan.xml	2001/11/13 13:29:32	1.2
  @@ -8,6 +8,229 @@
   <body>
   
   <section name="5. Building a Web Test Plan">
  +<p>In this section, you will learn how to create a basic 
  +<a href="">Test Plan</a> to test a Web site.  You will create five users that 
  +send requests to two pages on the Jakarta Web site. Also, you will tell the 
  +users to run their tests twice. So, the total number of requests is (5 users) 
  +x (2 requests) x (repeat 2 times) = 20 HTTP requests. To construct the Test 
  +Plan, you will use the following elements: <a href="">Thread Group</a>, 
  +<a href="">HTTP Request</a>, <a href="">HTTP Request Defaults</a>, and 
  +<a href="">File Reporter</a>.</p> 
  +
  +<p>For a more advanced Test Plan, see Section 6, <a href="">Building an Advanced Web Test 
  +Plan</a>.</p>
  +</section>
  +
  +<!--
  +<p>After starting JMeter, you see three items in the tree: Root (the parent of
  +all tree elements), Test Plan (you place all of your elements here), and 
  +WorkBench (a temporary place to store your elements while constructing a Test
  +Plan).</p>-->
  +
  +<section name="5.1 Adding Users">
  +<p>The first step you want to do with every JMeter Test Plan is to add a 
  +<a href="">Thread Group</a> element.  The Thread Group tells JMeter the number 
  +of users you want to simulate, how often the users should send requests, and 
  +the how many requests they should send.</p>
  +
  +<p>Go ahead and add the ThreadGroup element by first selecting the Test Plan, 
  +and then from the Edit menu, select Add --> ThreadGroup.</p>
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>TIP:</b> You can also access the Edit menu by selecting an element and then
  +clicking your right mouse button.</td></tr>
  +</table>
  +</p>
  +
  +<p>You should now see the Thread Group element under Test Plan.  If you do not 
  +see the element, then "expand" the Test Plan tree by double-clicking on the 
  +Test Plan element.</p>  
  +
  +<p>Next, you need to modify the default properties.  Select the Thread Group element 
  +in the tree, if you have not already selected it. You should now see the Thread 
  +Group Control Panel in the right section of the JMeter window (see Figure 5.1 
  +below)</p>
  +
  +<p><img src="../images/screenshots/webtest/threadgroup.gif" width="555" height="297"></img>
  +<br>Figure 5.1. Thread Group with Default Values</br></p>  
  +
  +<p>Start by providing a more descriptive name for our Thread Group. In 
  +the name field, enter Jakarta Users.</p> 
  +
  +<p>Next, increase the number of users (called threads) to 5.</p>  
  +
  +<p>In the next field, the Ramp-Up Period, leave the the default value of 0 
  +seconds.  This property tells JMeter how long to delay between starting each 
  +user. For example, if you enter a Ramp-Up Period of 5 seconds, JMeter will 
  +finish starting all of your users by the end of the 5 seconds.  So, if we have 
  +5 users and a 5 second Ramp-Up Period, then the delay between starting users 
  +would be 1 second (5 users / 5 seconds = 1 user per second).  If you set the 
  +value to 0, then JMeter will immediately start all of your users.</p>
  +
  +<p>Finally, clear the checkbox labeled "Forever", and enter a value of 2 in 
  +the Loop Count field.  This property tells JMeter how many times to repeat your 
  +test. If you enter a loop count value of 0, then JMeter will run your test only 
  +once. To have JMeter repeatedly run your Test Plan, select the Forever 
  +checkbox.</p> 
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>NOTE:</b> In most applications, you have to manually accept 
  +changes you make in a Control Panel.  However, in JMeter, the Control Panel 
  +automatically accepts your changes as you make them.  If you change the
  +name of an element, the tree will be updated with the new text after you
  +leave the Control Panel (for example, when selecting another tree element).</td></tr>
  +</table>
  +</p>
  +
  +<p>See Figure 5.2 for the completed Jakarta Users Thread Group.</p>
  +
  +<p><img src="../images/screenshots/webtest/threadgroup2.gif" width="555" height="297"></img>
  +<br>Figure 5.2. Jakarta Users Thread Group</br></p>  
  +
  +</section>
  +
  +<section name="5.2 Adding Default HTTP Request Properties">
  +<p>Now that we have defined our users, it is time define the tasks that they
  +will be performing.  In this section, you will specify the default settings
  +for your HTTP requests.  And then, in section 5.3, you will add HTTP Request
  +elements which use some of the default settings you specified here.</p>
  +
  +<p>Begin by selecting the Jakarta Users element. From the Edit menu, choose 
  +Add --> Config Element --> Defaults. Then, select this new
  +element to view its Control Panel (see Figure 5.3).</p>
  +
  +<p><img src="../images/screenshots/webtest/http-defaults1.gif" width="633" height="326"></img>
  +<br>Figure 5.3. HTTP Request Defaults</br></p>  
  +
  +<p>
  +Like most JMeter elements, the <a href="">HTTP Request Defaults</a> Control 
  +Panel has a name field that you can modify.  In this example, leave this field 
  +with the default value.</p>
  +
  +<p>Skip to the next field, which is the Web Server's Server Name/IP. For the
  +Test Plan that you are building, all HTTP requests will be sent to the same
  +Web server, jakarta.apache.org.  Enter this domain name into the field.
  +This is the only field that we will specify a default, so leave the remaining
  +fields with their default values.</p>
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>NOTE:</b> The HTTP Request Defaults element does not tell JMeter
  +to send an HTTP request.  It simply defines the default values that the
  +HTTP Request elements use.</td></tr>
  +</table>
  +</p>
  +<p>See Figure 5.4 for the completed HTTP Request Defaults element</p>
  +
  +<p><img src="../images/screenshots/webtest/http-defaults2.gif" width="633" height="326"></img>
  +<br>Figure 5.4. HTTP Defaults for our Test Plan</br></p>  
  +
  +</section>
  +
  +
  +<section name="5.3 Adding HTTP Requests">
  +
  +<p>In our Test Plan, we need to make two HTTP requests. The first one is for the 
  +Jakarta home page (http://jakarta.apache.org/), and the second one is for the 
  +Project Guidelines page (http://jakarta.apache.org/site/guidelines.html).</p>
  +
  +<p>Start by adding the first <a href="">HTTP Request</a> to the Jakarta Users 
  +element (Add --> Generative Controller --> HTTP Request). Then, select the HTTP 
  +Request element in the tree and edit the following properties (see Figure 5.5):
  +<ol>
  +<li>Change the Name field to "Home Page".</li>
  +<li>Set the Path field to "/".  Remember that you do not have to set the Server
  +Name field because you already specified this value in the HTTP Request Defaults
  +element.</li>
  +</ol>
  +</p>
  +
  +<p><img src="../images/screenshots/webtest/http-request1.gif" width="633" height="326"></img>
  +<br>Figure 5.5. HTTP Request for Jakarta Home Page</br></p>  
  +
  +<p>Next, add the second <a href="">HTTP Request</a> and edit the following 
  +properties (see 
  +Figure 5.56:
  +<ol>
  +<li>Change the Name field to "Project Guidelines".</li>
  +<li>Set the Path field to "/site/guidelines.html".</li>
  +</ol>
  +</p>
  +
  +<p><img src="../images/screenshots/webtest/http-request2.gif" width="633" height="326"></img>
  +<br>Figure 5.6. HTTP Request for Jakarta Project Guidelines Page</br></p>  
  +
  +
  +</section>
  +
  +<section name="5.3 Adding a File Reporter to Store the Test Results">
  +<p>The final element you need to add to your Test Plan is a 
  +<a href="">File Reporter Listener</a>. This element is responsible for 
  +storing all of the results of your HTTP requests in a file.</p>
  +
  +<p>Select the Jakarta Users element and add a File Reporter (Add --> Listener 
  +--> File Reporter).  Next, you need to specify a directory and filename of the
  +output file.  You can either type it into the filename field, or select the
  +Browse button and browse to a directory and then enter a filename.  Leave
  +all of the other fields with their default values (see Figure 5.7).</p>
  +
  +<p><img src="../images/screenshots/webtest/file-reporter.gif" width="633" height="340"></img>
  +<br>Figure 5.7. File Reporter Listener</br></p>  
  +
  +</section>
  +
  +<section name="5.4 Saving the Test Plan">
  +<p>Although it is not required, we recommend that you save the Test Plan to a 
  +file before running it.  To save the Test Plan, select the Test Plan element
  +in the tree. Then, select Save As from the File menu.</p>
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>NOTE:</b> JMeter allows you to save the entire Test Plan tree or 
  +only a portion of it.  JMeter uses the currently selected tree element
  +and saves all elements located in that particular "branch" of the tree.  
  +Because you want to save all of the elements, you must select the Test Plan 
  +element before selecting File --> Save As.</td></tr>
  +</table>
  +</p>
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>TIP:</b> You can also access the Save As menu item by selecting an 
  +element and then clicking your right mouse button.</td></tr>
  +</table>
  +</p>
  +
  +</section>
  +
  +<section name="5.5 Running the Test Plan">
  +<p>Before running the Test Plan, You have to manually open the File Reporter 
  +output file. Select the File Reporter tree element, and select the Open button, 
  +which is located at the bottom of the Control Panel.</p>
  +
  +<p>From the Run menu, select Run.</p>
  +
  +<p>
  +<table border="1" cellspacing="0" cellpadding="5">
  +  <tr><td><b>NOTE:</b> The current version of JMeter does not let you know
  +when it has finished running your Test Plan.  You have to determine this
  +by viewing the console output or the File Reporter output file.</td></tr>
  +</table>
  +</p>
  +
  +<p>Once JMeter has finished running your Test Plan, select Stop from the 
  +Run menu.</p>
  +<p>Next, you need to close the File Reporter output file.  Select
  +the File Reporter tree element, and select the Close button on the
  +Control Panel.</p>
  +<p>To view the results, open the File Reporter output file in a text
  +editor (see Figure 5.8). The format is [URL][space][Response time in milliseconds].</p>
  +
  +<p><img src="../images/screenshots/webtest/file-reporter-results.gif" width="432" height="396"></img>
  +<br>Figure 5.8. Test Plan Results</br></p>  
  +
   </section>
   
   </body>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>