Modified: jmeter/trunk/docs/usermanual/build-web-test-plan.html URL: http://svn.apache.org/viewvc/jmeter/trunk/docs/usermanual/build-web-test-plan.html?rev=1664961&r1=1664960&r2=1664961&view=diff ============================================================================== --- jmeter/trunk/docs/usermanual/build-web-test-plan.html (original) +++ jmeter/trunk/docs/usermanual/build-web-test-plan.html Sun Mar 8 10:22:58 2015 @@ -1,623 +1,227 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<!-- Content Stylesheet for Site --> - - -<!-- start the processing --> -<html> -<head> -<link rel="stylesheet" type="text/css" href="../css/style.css"/> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> - -<title>Apache JMeter - User's Manual: Building a Web Test Plan</title> -</head> - -<body bgcolor="#ffffff" text="#000000" link="#525D76"> -<table width="100%" cellspacing="0" border="0"> -<tr> -<td width="90%" align="left"> -<table border="0" cellspacing="0"> -<tr> -<td width="10%"> -<a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" border="0"/></a> -</td> -<td align="left" width="40%"> - -<a href="http://jmeter.apache.org/"><img width="182" height="88" src="../images/logo.jpg" alt="Apache JMeter" title="Apache JMeter" border="0"/></a> -</td> -</tr> -</table> -</td> -<td align="left" width="50%"> -<table cellspacing="0" align="right" border="0"> -<tr> -<td align="left"> <a href="https://twitter.com/share" -class="twitter-share-button" -data-text="Powerful Load Testing with -Apache #JMeter" data-via="ApacheJMeter" -data-lang="en-gb" data-size="large">Tweet</a> -<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> -</td> -<td align="right"> <a -href="https://twitter.com/ApacheJMeter" -class="twitter-follow-button" -data-show-count="false" data-lang="en-gb" -data-size="large">Follow</a> -<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> -</td> -</tr> -</table> -</td></tr> -</table> - -<table border="0" width="100%" cellspacing="4"> -<tr><td colspan="2"> -<hr noshade size="1"/> -</td></tr> -<tr> -<!-- LEFT SIDE NAVIGATION --> -<td width="20%" valign="top" nowrap="true"> -<table border="0" width="100%" cellspacing="0"> -<tr><td> -<p><strong>About</strong></p> -<ul> -<li><a href="../index.html">Overview</a> -</li> -<li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter</a> -<img src="../images/twitter.png" align="top"/></li> -<li><a href="../issues.html">Issue Tracking</a> -</li> -<li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a> -</li> -<li><a href="http://www.apache.org/licenses/">License</a> -</li> -</ul> -<p><strong>Download</strong></p> -<ul> -<li><a href="../download_jmeter.cgi">Download Releases</a> -</li> -<li><a href="../nightly.html">Developer (Nightly) Builds</a> -</li> -</ul> -<p><strong>Documentation</strong></p> -<ul> -<li><a href="../changes.html">Changes per version</a> -</li> -<li><a href="../usermanual/get-started.html">Get Started</a> -</li> -<li><a href="../usermanual/index.html">User Manual</a> -</li> -<li><a href="../usermanual/best-practices.html">Best Practices</a> -</li> -<li><a href="../usermanual/component_reference.html">Component Reference</a> -</li> -<li><a href="../usermanual/functions.html">Functions Reference</a> -</li> -<li><a href="../api/index.html">Javadocs</a> -</li> -<li><a href="../building.html">Building JMeter and Add-Ons</a> -</li> -<li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a> -</li> -<li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a> -</li> -</ul> -<p><strong>Tutorials (PDF format)</strong></p> -<ul> -<li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a> -</li> -<li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a> -</li> -<li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a> -</li> -<li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a> -</li> -<li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a> -</li> -</ul> -<p><strong>Community</strong></p> -<ul> -<li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a> -</li> -<li><a href="../mail.html">Mailing Lists</a> -</li> -<li><a href="../svnindex.html">SVN Repositories</a> -</li> -</ul> -<p><strong>Foundation</strong></p> -<ul> -<li><a href="http://www.apache.org/">ASF</a> -</li> -<li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a> -</li> -<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a> -</li> -<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a> -</li> -</ul> -</td></tr> -<tr><td> -<iframe src="http://www.apache.org/ads/button.html" style="border-width:0; float: left;" frameborder="0" scrolling="no"></iframe> -</td></tr> -</table> -</td> -<td width="80%" align="left" valign="top"> -<table> -<tr> -<td bgcolor="#525D76"> -<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-adv-web-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="test_plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div> -</td> -</tr> -</table> -<br> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="building"><strong>5. Building a Web Test Plan</strong></a><a class="sectionlink" href="#building" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -In this section, you will learn how to create a basic - -<a href="build-test-plan.html"> -Test Plan -</a> - to test a Web site. You will +<!DOCTYPE html SYSTEM "about:legacy-compat"> +<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter + - + User's Manual: Building a Web Test Plan</title><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!-- + APACHE LOGO + --><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!-- + PROJECT LOGO + --><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script> + (function(d,s,id){ + var js, + fjs=d.getElementsByTagName(s)[0], + p=/^http:/.test(d.location)?'http':'https'; + if (!d.getElementById(id)) { + js=d.createElement(s); + js.id=id; + js.src=p+'://platform.twitter.com/widgets.js'; + fjs.parentNode.insertBefore(js,fjs); + } + })(document, 'script', 'twitter-wjs'); + </script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){ + var js, + fjs=d.getElementsByTagName(s)[0], + p=/^http:/.test(d.location)?'http':'https'; + if (!d.getElementById(id)) { + js=d.createElement(s); + js.id=id; + js.src=p+'://platform.twitter.com/widgets.js'; + fjs.parentNode.insertBefore(js,fjs); + } + })(document, 'script', 'twitter-wjs'); + </script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html" >Changes per version</a></li><li><a href="../usermanual/get-started.html">Get >Started</a></li><li><a href="../usermanual/index.html">User >Manual</a></li><li><a href="../usermanual/best-practices.html">Best >Practices</a></li><li><a >href="../usermanual/component_reference.html">Component >Reference</a></li><li><a href="../usermanual/functions.html">Functions >Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a >href="../building.html">Building JMeter and Add-Ons</a></li><li><a >href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a >href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ >(Wiki)</a></li></ul></li></ul><ul class="menu"><li><div >class="menu-title">Tutorials (PDF format)</div><ul><li><a >href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed >Testing</a></li><li><a >href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording >Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit >Sampler</a></li><li><a href="../us ermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><ul class="pagelinks"><li><a href="test_plan.html">< Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-adv-web-test-pl an.html">Next ></a></li></ul><div class="section"><h1 id="building">5. Building a Web Test Plan<a class="sectionlink" href="#building" title="Link to here">¶</a></h1> +<p>In this section, you will learn how to create a basic +<a href="build-test-plan.html">Test Plan</a> to test a Web site. You will create five users that send requests to two pages on the JMeter 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="test_plan.html#thread_group">Thread Group</a>, +<a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a>, +<a href="../usermanual/component_reference.html#HTTP_Request_Defaults">HTTP Request Defaults</a>, and +<a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a>.</p> + +<p>For a more advanced Test Plan, see +<a href="build-adv-web-test-plan.html">Building an Advanced Web Test Plan</a>.</p> +</div><div class="section"><h1 id="adding_users">5.1 Adding Users<a class="sectionlink" href="#adding_users" title="Link to here">¶</a></h1> +<p>The first step you want to do with every JMeter Test Plan is to add a +<a href="test_plan.html#thread_group">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> -<a href="test_plan.html#thread_group"> -Thread Group -</a> -, +<p>Go ahead and add the ThreadGroup element by first selecting the Test Plan, +clicking your right mouse button to get the Add menu, and then select +Add --> ThreadGroup.</p> -<a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a> -, +<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 clicking on the +Test Plan element.</p> -<a href="../usermanual/component_reference.html#HTTP_Request_Defaults">HTTP Request Defaults</a> -, and +<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> -<a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a> -. -</p> -<p> -For a more advanced Test Plan, see +<figure><a href="../images/screenshots/webtest/threadgroup.png"><img src="../images/screenshots/webtest/threadgroup.png" width="609" height="289" alt=" +Figure 5.1. Thread Group with Default Values"></a><figcaption> +Figure 5.1. Thread Group with Default Values</figcaption></figure> -<a href="build-adv-web-test-plan.html"> -Building an Advanced Web Test Plan -</a> -. -</p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_users"><strong>5.1 Adding Users</strong></a><a class="sectionlink" href="#adding_users" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -The first step you want to do with every JMeter Test Plan is to add a +<p>Start by providing a more descriptive name for our Thread Group. In the name +field, enter JMeter Users.</p> -<a href="test_plan.html#thread_group"> -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, -clicking your right mouse button to get the Add menu, and then select -Add --> ThreadGroup. -</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 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><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='609' height='289' src="../images/screenshots/webtest/threadgroup.png"/><br> -<font size="-1"> -Figure 5.1. Thread Group with Default Values -</font></td></tr></table></p> -<p> -Start by providing a more descriptive name for our Thread Group. In the name -field, enter JMeter 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 1 +<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 1 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 enter a value of 2 in +value to 0, then JMeter will immediately start all of your users.</p> + +<p>Finally 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 1, 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" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2"> -<tr><td>In most applications, you have to manually accept +checkbox.</p> + +<div class="clear"></div><div class="note">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 JMeter Users Thread Group. -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1045' height='359' src="../images/screenshots/webtest/threadgroup2.png"/><br> -<font size="-1"> -Figure 5.2. JMeter Users Thread Group -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_defaults"><strong>5.2 Adding Default HTTP Request Properties</strong></a><a class="sectionlink" href="#adding_defaults" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -Now that we have defined our users, it is time to define the tasks that they +leave the Control Panel (for example, when selecting another tree element).</div><div class="clear"></div> + +<p>See Figure 5.2 for the completed JMeter Users Thread Group.</p> + +<figure><a href="../images/screenshots/webtest/threadgroup2.png"><img src="../images/screenshots/webtest/threadgroup2.png" width="1045" height="359" alt=" +Figure 5.2. JMeter Users Thread Group"></a><figcaption> +Figure 5.2. JMeter Users Thread Group</figcaption></figure> + +</div><div class="section"><h1 id="adding_defaults">5.2 Adding Default HTTP Request Properties<a class="sectionlink" href="#adding_defaults" title="Link to here">¶</a></h1> +<p>Now that we have defined our users, it is time to 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 JMeter Users (Thread Group) element. Click your right mouse button -to get the Add menu, and then select Add --> Config Element --> HTTP Request -Defaults. Then, select this new element to view its Control Panel (see Figure 5.3). +elements which use some of the default settings you specified here.</p> +<p>Begin by selecting the JMeter Users (Thread Group) element. Click your right mouse button +to get the Add menu, and then select Add --> Config Element --> HTTP Request +Defaults. Then, select this new element to view its Control Panel (see Figure 5.3). </p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1037' height='511' src="../images/screenshots/webtest/http-defaults1.png"/><br> -<font size="-1"> -Figure 5.3. HTTP Request Defaults -</font></td></tr></table></p> -<p> -Like most JMeter elements, the -<a href="../usermanual/component_reference.html#HTTP_Request_Defaults">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> +<figure><a href="../images/screenshots/webtest/http-defaults1.png"><img src="../images/screenshots/webtest/http-defaults1.png" width="1037" height="511" alt=" +Figure 5.3. HTTP Request Defaults"></a><figcaption> +Figure 5.3. HTTP Request Defaults</figcaption></figure> + <p> -Skip to the next field, which is the Web Server's Server Name/IP. For the +Like most JMeter elements, the <a href="../usermanual/component_reference.html#HTTP_Request_Defaults">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, jmeter.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" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2"> -<tr><td>The HTTP Request Defaults element does not tell JMeter +fields with their default values.</p> + +<div class="clear"></div><div class="note">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><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1036' height='513' src="../images/screenshots/webtest/http-defaults2.png"/><br> -<font size="-1"> -Figure 5.4. HTTP Defaults for our Test Plan -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_cookie_support"><strong>5.3 Adding Cookie Support</strong></a><a class="sectionlink" href="#adding_cookie_support" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -Nearly all web testing should use cookie support, unless your application +HTTP Request elements use.</div><div class="clear"></div> + +<p>See Figure 5.4 for the completed HTTP Request Defaults element</p> + +<figure><a href="../images/screenshots/webtest/http-defaults2.png"><img src="../images/screenshots/webtest/http-defaults2.png" width="1036" height="513" alt=" +Figure 5.4. HTTP Defaults for our Test Plan"></a><figcaption> +Figure 5.4. HTTP Defaults for our Test Plan</figcaption></figure> + +</div><div class="section"><h1 id="adding_cookie_support">5.3 Adding Cookie Support<a class="sectionlink" href="#adding_cookie_support" title="Link to here">¶</a></h1> +<p>Nearly all web testing should use cookie support, unless your application specifically doesn't use cookies. To add cookie support, simply add an +<a href="../usermanual/component_reference.html#HTTP_Cookie_Manager">HTTP Cookie Manager</a> to each <a href="test_plan.html#thread_group">Thread +Group</a> in your test plan. This will ensure that each thread gets its own +cookies, but shared across all <a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a> objects.</p> + +<p>To add the <a href="../usermanual/component_reference.html#HTTP_Cookie_Manager">HTTP Cookie Manager</a>, simply select the +<a href="test_plan.html#thread_group">Thread Group</a>, and choose Add --> +Config Element --> HTTP +Cookie Manager, either from the Edit Menu, or from the right-click pop-up menu.</p> +</div><div class="section"><h1 id="adding_requests">5.4 Adding HTTP Requests<a class="sectionlink" href="#adding_requests" title="Link to here">¶</a></h1> -<a href="../usermanual/component_reference.html#HTTP_Cookie_Manager">HTTP Cookie Manager</a> - to each -<a href="test_plan.html#thread_group"> -Thread -Group -</a> - in your test plan. This will ensure that each thread gets its own -cookies, but shared across all -<a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a> - objects. -</p> -<p> -To add the -<a href="../usermanual/component_reference.html#HTTP_Cookie_Manager">HTTP Cookie Manager</a> -, simply select the - -<a href="test_plan.html#thread_group"> -Thread Group -</a> -, and choose Add --> -Config Element --> HTTP -Cookie Manager, either from the Edit Menu, or from the right-click pop-up menu. -</p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_requests"><strong>5.4 Adding HTTP Requests</strong></a><a class="sectionlink" href="#adding_requests" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -In our Test Plan, we need to make two HTTP requests. The first one is for the +<p>In our Test Plan, we need to make two HTTP requests. The first one is for the JMeter home page (http://jmeter.apache.org/), and the second one is for the -Changes page (http://jmeter.apache.org/changes.html). -</p> -<p> -<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2"> -<tr><td>JMeter sends requests in the order that they appear in the tree. -</td></tr> -</table> -</p> -<p> -Start by adding the first -<a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a> +Changes page (http://jmeter.apache.org/changes.html).</p> + +<div class="clear"></div><div class="note">JMeter sends requests in the order that they appear in the tree.</div><div class="clear"></div> -to the JMeter Users element (Add --> Sampler --> HTTP Request). +<p>Start by adding the first <a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a> +to the JMeter Users element (Add --> Sampler --> 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 +<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> - - +element.</li> </ol> +</p> +<figure><a href="../images/screenshots/webtest/http-request1.png"><img src="../images/screenshots/webtest/http-request1.png" width="1140" height="693" alt=" +Figure 5.5. HTTP Request for JMeter Home Page"></a><figcaption> +Figure 5.5. HTTP Request for JMeter Home Page</figcaption></figure> -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1140' height='693' src="../images/screenshots/webtest/http-request1.png"/><br> -<font size="-1"> -Figure 5.5. HTTP Request for JMeter Home Page -</font></td></tr></table></p> -<p> -Next, add the second HTTP Request and edit the following properties (see +<p>Next, add the second HTTP Request and edit the following properties (see Figure 5.6: - <ol> - - -<li> -Change the Name field to "Changes". -</li> - - -<li> -Set the Path field to "/changes.html". -</li> - - +<li>Change the Name field to "Changes".</li> +<li>Set the Path field to "/changes.html".</li> </ol> - - </p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1145' height='695' src="../images/screenshots/webtest/http-request2.png"/><br> -<font size="-1"> -Figure 5.6. HTTP Request for JMeter Changes Page -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_listener"><strong>5.5 Adding a Listener to View Store the Test Results</strong></a><a class="sectionlink" href="#adding_listener" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -The final element you need to add to your Test Plan is a - -<a href="component_reference.html#listeners"> -Listener -</a> -. This element is + +<figure><a href="../images/screenshots/webtest/http-request2.png"><img src="../images/screenshots/webtest/http-request2.png" width="1145" height="695" alt=" +Figure 5.6. HTTP Request for JMeter Changes Page"></a><figcaption> +Figure 5.6. HTTP Request for JMeter Changes Page</figcaption></figure> + +</div><div class="section"><h1 id="adding_listener">5.5 Adding a Listener to View Store the Test Results<a class="sectionlink" href="#adding_listener" title="Link to here">¶</a></h1> +<p>The final element you need to add to your Test Plan is a + <a href="component_reference.html#listeners">Listener</a>. This element is responsible for storing all of the results of your HTTP requests in a file and presenting -a visual model of the data. -</p> -<p> -Select the JMeter Users element and add a -<a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a> - listener (Add --> Listener ---> Graph Results). Next, you need to specify a directory and filename of the +a visual model of the data.</p> + +<p>Select the JMeter Users element and add a <a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a> listener (Add --> Listener +--> Graph Results). 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. -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='915' height='686' src="../images/screenshots/graph_results.png"/><br> -<font size="-1"> -Figure 5.7. Graph Results Listener -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="logging_in"><strong>5.6 Logging in to a web-site</strong></a><a class="sectionlink" href="#logging_in" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> +Browse button and browse to a directory and then enter a filename.</p> +<figure><a href="../images/screenshots/graph_results.png"><img src="../images/screenshots/graph_results.png" width="915" height="686" alt=" +Figure 5.7. Graph Results Listener"></a><figcaption> +Figure 5.7. Graph Results Listener</figcaption></figure> + +</div><div class="section"><h1 id="logging_in">5.6 Logging in to a web-site<a class="sectionlink" href="#logging_in" title="Link to here">¶</a></h1> +<p> It's not the case here, but some web-sites require you to login before permitting you to perform certain actions. In a web-browser, the login will be shown as a form for the user name and password, and a button to submit the form. The button generates a POST request, passing the values of the form items as parameters. - </p> <p> - To do this in JMeter, add an HTTP Request, and set the method to POST. You'll need to know the names of the fields used by the form, and the target page. These can be found out by inspecting the code of the login page. -[If this is difficult to do, you can use the -<a href="component_reference.html#HTTP_Proxy_Server"> -JMeter Proxy Recorder -</a> - to record the login sequence.] +[If this is difficult to do, you can use the <a href="component_reference.html#HTTP_Proxy_Server">JMeter Proxy Recorder</a> to record the login sequence.] Set the path to the target of the submit button. Click the Add button twice and enter the username and password details. Sometimes the login form contains additional hidden fields. These will need to be added as well. - -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='898' height='682' src="../images/screenshots/webtest/http_login.png"/><br> -<font size="-1"> -Figure 5.8. Sample HTTP login request -</font></td></tr></table></p> -</blockquote> </p> -</td></tr> -<tr><td><br></td></tr> -</table> -<br> -<table> -<tr> -<td bgcolor="#525D76"> -<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-adv-web-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="test_plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div> -</td> -</tr> -</table> -</td> -</tr> -<tr><td colspan="2"> -<hr noshade size="1"/> -</td></tr> -<tr><td colspan="2"> -<div align="center"><font color="#525D76" size="-1"><em> -Copyright © 1999-2015, Apache Software Foundation -</em></font></div> -</td></tr> -<tr><td colspan="2"> -<div align="center"><font color="#525D76" size="-1"> -Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are -trademarks of the Apache Software Foundation. -</font> -</div> -</td></tr> -</table> -</body> -</html> -<!-- end the processing --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +<figure><a href="../images/screenshots/webtest/http_login.png"><img src="../images/screenshots/webtest/http_login.png" width="898" height="682" alt=" +Figure 5.8. Sample HTTP login request"></a><figcaption> +Figure 5.8. Sample HTTP login request</figcaption></figure> + +</div><ul class="pagelinks"><li><a href="test_plan.html">< Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-adv-web-test-plan.html">Next ></a></li></ul></div><div class="footer"><div class="copyright"> + Copyright © + 1999 – + 2015 + , Apache Software Foundation + </div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache + feather, and the Apache JMeter logo are + trademarks of the + Apache Software Foundation. + </div></div></body></html> \ No newline at end of file
Modified: jmeter/trunk/docs/usermanual/build-ws-test-plan.html URL: http://svn.apache.org/viewvc/jmeter/trunk/docs/usermanual/build-ws-test-plan.html?rev=1664961&r1=1664960&r2=1664961&view=diff ============================================================================== --- jmeter/trunk/docs/usermanual/build-ws-test-plan.html (original) +++ jmeter/trunk/docs/usermanual/build-ws-test-plan.html Sun Mar 8 10:22:58 2015 @@ -1,510 +1,161 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<!-- Content Stylesheet for Site --> - - -<!-- start the processing --> -<html> -<head> -<link rel="stylesheet" type="text/css" href="../css/style.css"/> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> - -<title>Apache JMeter - User's Manual: Building a WebService Test Plan</title> -</head> - -<body bgcolor="#ffffff" text="#000000" link="#525D76"> -<table width="100%" cellspacing="0" border="0"> -<tr> -<td width="90%" align="left"> -<table border="0" cellspacing="0"> -<tr> -<td width="10%"> -<a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" border="0"/></a> -</td> -<td align="left" width="40%"> - -<a href="http://jmeter.apache.org/"><img width="182" height="88" src="../images/logo.jpg" alt="Apache JMeter" title="Apache JMeter" border="0"/></a> -</td> -</tr> -</table> -</td> -<td align="left" width="50%"> -<table cellspacing="0" align="right" border="0"> -<tr> -<td align="left"> <a href="https://twitter.com/share" -class="twitter-share-button" -data-text="Powerful Load Testing with -Apache #JMeter" data-via="ApacheJMeter" -data-lang="en-gb" data-size="large">Tweet</a> -<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> -</td> -<td align="right"> <a -href="https://twitter.com/ApacheJMeter" -class="twitter-follow-button" -data-show-count="false" data-lang="en-gb" -data-size="large">Follow</a> -<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> -</td> -</tr> -</table> -</td></tr> -</table> - -<table border="0" width="100%" cellspacing="4"> -<tr><td colspan="2"> -<hr noshade size="1"/> -</td></tr> -<tr> -<!-- LEFT SIDE NAVIGATION --> -<td width="20%" valign="top" nowrap="true"> -<table border="0" width="100%" cellspacing="0"> -<tr><td> -<p><strong>About</strong></p> -<ul> -<li><a href="../index.html">Overview</a> -</li> -<li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter</a> -<img src="../images/twitter.png" align="top"/></li> -<li><a href="../issues.html">Issue Tracking</a> -</li> -<li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a> -</li> -<li><a href="http://www.apache.org/licenses/">License</a> -</li> -</ul> -<p><strong>Download</strong></p> -<ul> -<li><a href="../download_jmeter.cgi">Download Releases</a> -</li> -<li><a href="../nightly.html">Developer (Nightly) Builds</a> -</li> -</ul> -<p><strong>Documentation</strong></p> -<ul> -<li><a href="../changes.html">Changes per version</a> -</li> -<li><a href="../usermanual/get-started.html">Get Started</a> -</li> -<li><a href="../usermanual/index.html">User Manual</a> -</li> -<li><a href="../usermanual/best-practices.html">Best Practices</a> -</li> -<li><a href="../usermanual/component_reference.html">Component Reference</a> -</li> -<li><a href="../usermanual/functions.html">Functions Reference</a> -</li> -<li><a href="../api/index.html">Javadocs</a> -</li> -<li><a href="../building.html">Building JMeter and Add-Ons</a> -</li> -<li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a> -</li> -<li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a> -</li> -</ul> -<p><strong>Tutorials (PDF format)</strong></p> -<ul> -<li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a> -</li> -<li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a> -</li> -<li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a> -</li> -<li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a> -</li> -<li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a> -</li> -</ul> -<p><strong>Community</strong></p> -<ul> -<li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a> -</li> -<li><a href="../mail.html">Mailing Lists</a> -</li> -<li><a href="../svnindex.html">SVN Repositories</a> -</li> -</ul> -<p><strong>Foundation</strong></p> -<ul> -<li><a href="http://www.apache.org/">ASF</a> -</li> -<li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a> -</li> -<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a> -</li> -<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a> -</li> -</ul> -</td></tr> -<tr><td> -<iframe src="http://www.apache.org/ads/button.html" style="border-width:0; float: left;" frameborder="0" scrolling="no"></iframe> -</td></tr> -</table> -</td> -<td width="80%" align="left" valign="top"> -<table> -<tr> -<td bgcolor="#525D76"> -<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-jms-point-to-point-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div> -</td> -</tr> -</table> -<br> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="building"><strong>10. Building a WebService Test Plan</strong></a><a class="sectionlink" href="#building" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -In this section, you will learn how to create a - -<a href="build-test-plan.html"> -Test Plan -</a> - to test a WebService. You will +<!DOCTYPE html SYSTEM "about:legacy-compat"> +<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter + - + User's Manual: Building a SOAP WebService Test Plan</title><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!-- + APACHE LOGO + --><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!-- + PROJECT LOGO + --><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script> + (function(d,s,id){ + var js, + fjs=d.getElementsByTagName(s)[0], + p=/^http:/.test(d.location)?'http':'https'; + if (!d.getElementById(id)) { + js=d.createElement(s); + js.id=id; + js.src=p+'://platform.twitter.com/widgets.js'; + fjs.parentNode.insertBefore(js,fjs); + } + })(document, 'script', 'twitter-wjs'); + </script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){ + var js, + fjs=d.getElementsByTagName(s)[0], + p=/^http:/.test(d.location)?'http':'https'; + if (!d.getElementById(id)) { + js=d.createElement(s); + js.id=id; + js.src=p+'://platform.twitter.com/widgets.js'; + fjs.parentNode.insertBefore(js,fjs); + } + })(document, 'script', 'twitter-wjs'); + </script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html" >Changes per version</a></li><li><a href="../usermanual/get-started.html">Get >Started</a></li><li><a href="../usermanual/index.html">User >Manual</a></li><li><a href="../usermanual/best-practices.html">Best >Practices</a></li><li><a >href="../usermanual/component_reference.html">Component >Reference</a></li><li><a href="../usermanual/functions.html">Functions >Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a >href="../building.html">Building JMeter and Add-Ons</a></li><li><a >href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a >href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ >(Wiki)</a></li></ul></li></ul><ul class="menu"><li><div >class="menu-title">Tutorials (PDF format)</div><ul><li><a >href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed >Testing</a></li><li><a >href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording >Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit >Sampler</a></li><li><a href="../us ermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><ul class="pagelinks"><li><a href="build-ldapext-test-plan.html">< Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-j ms-point-to-point-test-plan.html">Next ></a></li></ul><div class="section"><h1 id="building">10. Building a WebService Test Plan<a class="sectionlink" href="#building" title="Link to here">¶</a></h1> +<p>In this section, you will learn how to create a +<a href="build-test-plan.html">Test Plan</a> to test a WebService. You will create five users that send requests to One page. Also, you will tell the users to run their tests twice. So, the total number of requests is (5 users) x (1 requests) x (repeat 2 times) = 10 HTTP requests. To construct the Test Plan, you will use the following elements: +<a href="test_plan.html#thread_group">Thread Group</a>, +<a href="../usermanual/component_reference.html#HTTP_Request">HTTP Request</a>, and +<a href="../usermanual/component_reference.html#Aggregate_Graph">Aggregate Graph</a>.</p> -<a href="test_plan.html#thread_group"> -Thread Group -</a> -, - -<a href="../usermanual/component_reference.html#WebService(SOAP)_Request">WebService(SOAP) Request</a> -, and - -<a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a> -. -</p> -<p> -If the sampler appears to be getting an error from the webservice, double check the +<p>If the sampler appears to be getting an error from the webservice, double check the SOAP message and make sure the format is correct. In particular, make sure the xmlns attributes are exactly the same as the WSDL. If the xml namespace is -different, the webservice will likely return an error. -<a href="http://www.xmethods.net"> +different, the webservice will likely return an error.</p> -Xmethods -</a> - contains a list of public webservice for those who want to test -their test plan. -</p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_users"><strong>10.1 Adding Users</strong></a><a class="sectionlink" href="#adding_users" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -The first step you want to do with every JMeter Test Plan is to add a - -<a href="test_plan.html#thread_group"> -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, -clicking your right mouse button to get the Add menu, and then select -Add --> ThreadGroup. -</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 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 10.1 -below) -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../images/screenshots/webtest/threadgroup.png"/><br> -<font size="-1"> -Figure 10.1. Thread Group with Default Values -</font></td></tr></table></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 10. -</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" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2"> -<tr><td>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 10.2 for the completed Jakarta Users Thread Group. -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../images/screenshots/webtest/threadgroup2.png"/><br> -<font size="-1"> -Figure 10.2. Jakarta Users Thread Group -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_requests"><strong>10.2 Adding WebService Requests</strong></a><a class="sectionlink" href="#adding_requests" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -In our Test Plan, we will use a .NET webservice. Since you're using -the webservice sampler, we won't go into the details of writing a +</div><div class="section"><h1 id="soap_webservice_template">10.1 Creating WebService Test Plan<a class="sectionlink" href="#soap_webservice_template" title="Link to here">¶</a></h1> + +<p>In our Test Plan, we will use a .NET webservice. We won't go into the details of writing a webservice. If you don't know how to write a webservice, google for webservice and familiarize yourself with writing webservices for Java and .NET. It should be noted there is a significant difference between how .NET and Java implement webservices. The topic is too broad to cover in the user manual. Please refer to other sources to -get a better idea of the differences. -</p> -<p> -<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2"> -<tr><td>JMeter sends requests in the order that they appear in the tree. -</td></tr> -</table> -</p> -<p> -Start by adding the sampler -<a href="../usermanual/component_reference.html#WebService(SOAP)_Request">WebService(SOAP) Request</a> - -to the Jakarta Users element (Add --> Sampler --> WebService(SOAP) Request). -Then, select the webservice Request element in the tree and edit the following properties -(see Figure 10.5): +get a better idea of the differences.</p> -<ol> +<div class="clear"></div><div class="note">JMeter sends requests in the order that they appear in the tree.</div><div class="clear"></div> +<p>Start by using menu File > "Templates..." and select template "Building a SOAP Webservice Test Plan". +Then, click "Create" button. -<li> -Change the Name field to "WebService(SOAP) Request". -</li> - - -<li> -Enter the WSDL URL and click "Load WSDL". +<figure><a href="../images/screenshots/ws_template.png"><img src="../images/screenshots/ws_template.png" width="1050" height="684" alt=" +Figure 10.1.0. Webservice Template"></a><figcaption> +Figure 10.1.0. Webservice Template</figcaption></figure> +Change the following: +<ol> +<li>In "HTTP Request Defaults" change "Server Name of IP"</li> +<li>In "Soap Request", change "Path:" +<figure><a href="../images/screenshots/ws_http_request.png"><img src="../images/screenshots/ws_http_request.png" width="998" height="734" alt="Figure 10.1.1 Webservice Path"></a><figcaption>Figure 10.1.1 Webservice Path</figcaption></figure> </li> - - </ol> - - -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../images/screenshots/webservice_sampler.png"/><br> -<font size="-1"> -Figure 10.3. Webservice Request -</font></td></tr></table></p> -<p> -If the WSDL file was loaded correctly, the "Web Methods" drop down should -be populated. If the drop down remains blank, it means there was a problem -getting the WSDL. You can test the WSDL using a browser that reads XML. -For example, if you're testing an IIS webservice the URL will look like this: -http://localhost/myWebService/Service.asmx?WSDL. At this point, SOAPAction, URL -and SOAP Data should be blank. </p> -<p> -Next, select the web method and click "Configure". The sampler should -populate the "URL" and "SOAPAction" text fields. Assuming the WSDL is valid, -the correct soap action should be entered. -</p> -<p> -The last step is to paste the SOAP message in the "SOAP/XML-RPC Data" -text area. You can optionally save the soap message to a file and browse -to the location. For convienance, there is a third option of using a -message folder. The sampler will randomly select files from a given -folder and use the text for the soap message. -</p> -<p> -If you do not want JMeter to read the response from the SOAP Webservice, -uncheck "Read Soap Responses." If the test plan is intended to stress test -a webservice, the box should be unchecked. If the test plan is a functional -test, the box should be checked. When "Read Soap Responses" is unchecked, -no result will be displayed in view result tree or view results in table. -</p> -<p> -An important note on the sampler. It will automatically use the proxy host -and port passed to JMeter from command line, if those fields in the sampler are -left blank. If a sampler has values in the proxy host and port text field, it -will use the ones provided by the user. If no host or port are provided and -JMeter wasn't started with command line options, the sampler will fail -silently. This behavior may not be what users expect. -</p> -<p> -<b> -Note: -</b> - If you're using Cassini webserver, it does not work correctly and is not a reliable webserver. Cassini is meant to be a simple example and isn't a full blown webserver like IIS. Cassini does not close connections correctly, which causes JMeter to hang or not get the response contents. -</p> -<p> +<p>Next, select "HTTP Header Manager" and update "SOAPAction" header to match your webservice. +Some webservices may not use SOAPAction in this case remove it.<br> Currently, only .NET uses SOAPAction, so it is normal to have a blank SOAPAction for all other webservices. The list includes JWSDP, Weblogic, Axis, The Mind Electric Glue, and gSoap. </p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<table border="0" cellspacing="0" cellpadding="2" width="100%"> -<tr><td bgcolor="#525D76"> -<font color="#ffffff" face="arial,helvetica,sanserif"> -<a name="adding_listener"><strong>10.3 Adding a Listener to View Store the Test Results</strong></a><a class="sectionlink" href="#adding_listener" title="Link to here">¶</a></font> -</td></tr> -<tr><td> -<blockquote> -<p> -The final element you need to add to your Test Plan is a - -<a href="component_reference.html#listeners"> -Listener -</a> -. This element is -responsible for storing all of the results of your HTTP requests in a file and presenting -a visual model of the data. -</p> -<p> -Select the Jakarta Users element and add a -<a href="../usermanual/component_reference.html#Graph_Results">Graph Results</a> - listener (Add --> Listener ---> Graph Results). 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. -</p> -<p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='915' height='686' src="../images/screenshots/graph_results.png"/><br> -<font size="-1"> -Figure 10.7. Graph Results Listener -</font></td></tr></table></p> -</blockquote> -</p> -</td></tr> -<tr><td><br></td></tr> -</table> -<br> -<table> -<tr> -<td bgcolor="#525D76"> -<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-jms-point-to-point-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div> -</td> -<td bgcolor="#525D76"> -<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div> -</td> -</tr> -</table> -</td> -</tr> -<tr><td colspan="2"> -<hr noshade size="1"/> -</td></tr> -<tr><td colspan="2"> -<div align="center"><font color="#525D76" size="-1"><em> -Copyright © 1999-2015, Apache Software Foundation -</em></font></div> -</td></tr> -<tr><td colspan="2"> -<div align="center"><font color="#525D76" size="-1"> -Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are -trademarks of the Apache Software Foundation. -</font> -</div> -</td></tr> -</table> -</body> -</html> -<!-- end the processing --> - - - - - - - - - - - - - - - - - - - - - - +<figure><a href="../images/screenshots/ws_header.png"><img src="../images/screenshots/ws_header.png" width="1327" height="348" alt="Figure 10.1.2 Webservice Headers"></a><figcaption>Figure 10.1.2 Webservice Headers</figcaption></figure> +<p>The last step is to paste the SOAP message in the "Body Data" +text area.</p> +<figure><a href="../images/screenshots/ws_http_request.png"><img src="../images/screenshots/ws_http_request.png" width="998" height="734" alt="Figure 10.1.3 Webservice Body"></a><figcaption>Figure 10.1.3 Webservice Body</figcaption></figure> +</div><div class="section"><h1 id="adding_users">10.2 Adding Users<a class="sectionlink" href="#adding_users" title="Link to here">¶</a></h1> +<p>The <a href="test_plan.html#thread_group">Thread Group</a> 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>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 10.2 +below)</p> +<figure><a href="../images/screenshots/webtest/threadgroup.png"><img src="../images/screenshots/webtest/threadgroup.png" width="" height="" alt=" +Figure 10.2. Thread Group with Default Values"></a><figcaption> +Figure 10.2. Thread Group with Default Values</figcaption></figure> +<p>Start by providing a more descriptive name for our Thread Group. In the name +field, enter JMeter Users.</p> +<p>Next, increase the number of users (called threads) to 10.</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> +<div class="clear"></div><div class="note">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).</div><div class="clear"></div> +<p>See Figure 10.2 for the completed JMeter Users Thread Group.</p> +<figure><a href="../images/screenshots/webtest/threadgroup2.png"><img src="../images/screenshots/webtest/threadgroup2.png" width="" height="" alt=" +Figure 10.3. JMeter Users Thread Group"></a><figcaption> +Figure 10.3. JMeter Users Thread Group</figcaption></figure> +</div><div class="section"><h1 id="adding_listener">10.3 Adding a Listener to View Store the Test Results<a class="sectionlink" href="#adding_listener" title="Link to here">¶</a></h1> +<p>The final element you need to add to your Test Plan is a + <a href="component_reference.html#listeners">Listener</a>. This element is +responsible for storing all of the results of your HTTP requests in a file and presenting +a visual model of the data.</p> +<p>Select the JMeter Users element and add a <a href="../usermanual/component_reference.html#Aggregate_Graph">Aggregate Graph</a> listener (Add --> Listener +--> Aggregate Graph). 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.</p> +<figure><a href="../images/screenshots/ws_listener.png"><img src="../images/screenshots/ws_listener.png" width="1256" height="802" alt=" +Figure 10.4. Graph Results Listener"></a><figcaption> +Figure 10.4. Graph Results Listener</figcaption></figure> + +</div><div class="section"><h1 id="rest_webservice">10.4 Rest Webservice<a class="sectionlink" href="#rest_webservice" title="Link to here">¶</a></h1> +<p>Testing a REST Webservice is very similar as you only need to modify in HTTP Request +<ul> +<li>Method: to select the one you want to test</li> +<li>Body Data: which can be JSON, XML or any custom text</li> +</ul> +You may also need to modify "HTTP Header Manager" to select the correct "Content-Type" +</p> +</div><ul class="pagelinks"><li><a href="build-ldapext-test-plan.html">< Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-jms-point-to-point-test-plan.html">Next ></a></li></ul></div><div class="footer"><div class="copyright"> + Copyright © + 1999 – + 2015 + , Apache Software Foundation + </div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache + feather, and the Apache JMeter logo are + trademarks of the + Apache Software Foundation. + </div></div></body></html> \ No newline at end of file
