2001-10-28 21:26:00 +08:00
|
|
|
<?xml version="1.0"?>
|
2004-02-14 09:20:53 +08:00
|
|
|
<!--
|
2019-12-28 21:03:53 +08:00
|
|
|
~ 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.
|
|
|
|
|
-->
|
2007-08-21 02:07:53 +08:00
|
|
|
|
|
|
|
|
<!DOCTYPE document
|
|
|
|
|
[
|
2016-10-31 23:52:25 +08:00
|
|
|
<!ENTITY sect-num '7'>
|
2015-05-01 03:45:36 +08:00
|
|
|
<!ENTITY rarr "→" >
|
2007-08-21 02:07:53 +08:00
|
|
|
]>
|
|
|
|
|
|
2011-09-26 06:28:22 +08:00
|
|
|
<document prev="build-db-test-plan.html" next="build-ldap-test-plan.html" id="$Id$">
|
2001-10-28 21:26:00 +08:00
|
|
|
|
|
|
|
|
<properties>
|
2002-06-20 03:56:21 +08:00
|
|
|
<title>User's Manual: Building an FTP Test Plan</title>
|
2001-10-28 21:26:00 +08:00
|
|
|
</properties>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<section name="§-num;. Building an FTP Test Plan" anchor="building">
|
2002-06-20 03:56:21 +08:00
|
|
|
<p>In this section, you will learn how to create a basic
|
|
|
|
|
<a href="build-test-plan.html">Test Plan</a> to test an FTP site. You will
|
2013-07-15 22:17:20 +08:00
|
|
|
create four users that send requests for two files on a FTP site.
|
2002-06-20 03:56:21 +08:00
|
|
|
Also, you will tell the users to run their tests twice. So, the total number of
|
2013-07-15 22:17:20 +08:00
|
|
|
requests is (4 users) x (2 requests) x (repeat 2 times) = 16 FTP requests.</p>
|
|
|
|
|
<p>To construct the Test Plan, you will use the following elements:
|
2002-06-20 03:56:21 +08:00
|
|
|
<a href="test_plan.html#thread_group">Thread Group</a>,
|
|
|
|
|
<complink name="FTP Request"/>,
|
|
|
|
|
<complink name="FTP Request Defaults"/>, and
|
2013-07-15 22:17:20 +08:00
|
|
|
<complink name="View Results in Table"/>.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<section name="§-num;.1 Adding Users" anchor="adding_users">
|
2002-06-20 03:56:21 +08:00
|
|
|
<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>
|
|
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Go ahead and add the Thread Group element by first selecting the Test Plan,
|
2002-06-20 03:56:21 +08:00
|
|
|
clicking your right mouse button to get the Add menu, and then select
|
2015-05-01 03:45:36 +08:00
|
|
|
<b>Add</b> → <b>ThreadGroup.</b></p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>You should now see the <b>Thread Group</b> element under <b>Test Plan.</b> If you do not
|
2002-06-20 03:56:21 +08:00
|
|
|
see the element, then "expand" the Test Plan tree by clicking on the
|
2013-07-15 22:17:20 +08:00
|
|
|
<b>Test Plan</b> element.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Next, you need to modify the default properties. Select the <b>Thread Group</b> element
|
2002-06-20 03:56:21 +08:00
|
|
|
in the tree, if you have not already selected it. You should now see the Thread
|
2007-08-21 02:07:53 +08:00
|
|
|
Group Control Panel in the right section of the JMeter window (see Figure §-num;.1
|
2002-06-20 03:56:21 +08:00
|
|
|
below)</p>
|
|
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="webtest/threadgroup.png">
|
2007-08-21 02:07:53 +08:00
|
|
|
Figure §-num;.1. Thread Group with Default Values</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Start by providing a more descriptive name for our <b>Thread Group.</b> In the name
|
|
|
|
|
field, enter 'FTP Users'.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2007-07-04 03:36:51 +08:00
|
|
|
<p>Next, increase the number of users to 4.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2015-08-09 19:50:46 +08:00
|
|
|
<p>In the next field, the <i>Ramp-Up</i> Period, leave the default value of 0
|
2002-06-20 03:56:21 +08:00
|
|
|
seconds. This property tells JMeter how long to delay between starting each
|
2013-07-15 22:17:20 +08:00
|
|
|
user. For example, if you enter a <i>Ramp-Up</i> Period of 5 seconds, JMeter will
|
2002-06-20 03:56:21 +08:00
|
|
|
finish starting all of your users by the end of the 5 seconds. So, if we have
|
2013-07-15 22:17:20 +08:00
|
|
|
5 users and a 5 second <i>Ramp-Up</i> Period, then the delay between starting users
|
2002-06-20 03:56:21 +08:00
|
|
|
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>
|
|
|
|
|
|
2007-07-04 03:36:51 +08:00
|
|
|
<p>Finally, enter a value of 2 in
|
2013-07-15 22:17:20 +08:00
|
|
|
the <i>Loop Count</i> field. This property tells JMeter how many times to repeat your
|
|
|
|
|
test. To have JMeter repeatedly run your <b>Test Plan,</b> select the <i>Forever</i>
|
2002-06-20 03:56:21 +08:00
|
|
|
checkbox.</p>
|
|
|
|
|
|
|
|
|
|
<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).</note>
|
|
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>See Figure §-num;.2 for the completed FTP Users Thread Group.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="ftptest/threadgroup2.png">
|
2013-07-15 22:17:20 +08:00
|
|
|
Figure §-num;.2. FTP Users Thread Group</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<section name="§-num;.2 Adding Default FTP Request Properties" anchor="adding_defaults">
|
2002-06-20 03:56:21 +08:00
|
|
|
<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
|
2013-07-15 22:17:20 +08:00
|
|
|
for your FTP requests. And then, in section §-num;.3, you will add <b>FTP Request</b>
|
2002-06-20 03:56:21 +08:00
|
|
|
elements which use some of the default settings you specified here.</p>
|
|
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Begin by selecting the FTP Users element. Click your right mouse button
|
2015-05-01 03:45:36 +08:00
|
|
|
to get the Add menu, and then select <b>Add</b> → <b>Config Element</b> → <b>FTP Request
|
2013-07-15 22:17:20 +08:00
|
|
|
Defaults.</b> Then, select this new element to view its Control Panel (see Figure §-num;.3).
|
2002-06-26 08:59:49 +08:00
|
|
|
</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="ftptest/ftp-defaults.png">
|
2007-08-21 02:07:53 +08:00
|
|
|
Figure §-num;.3. FTP Request Defaults</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
Like most JMeter elements, the <complink name="FTP Request Defaults"/> 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 FTP Server's Server Name/IP. For the
|
|
|
|
|
Test Plan that you are building, all FTP requests will be sent to the same
|
2013-07-15 22:17:20 +08:00
|
|
|
FTP server, ftp.domain.com in this case. Enter this domain name into the field.
|
2002-06-20 03:56:21 +08:00
|
|
|
This is the only field that we will specify a default, so leave the remaining
|
|
|
|
|
fields with their default values.</p>
|
|
|
|
|
|
|
|
|
|
<note>The FTP Request Defaults element does not tell JMeter
|
|
|
|
|
to send an FTP request. It simply defines the default values that the
|
|
|
|
|
FTP Request elements use.</note>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<p>See Figure §-num;.4 for the completed FTP Request Defaults element</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="ftptest/ftp-defaults2.png">
|
2007-08-21 02:07:53 +08:00
|
|
|
Figure §-num;.4. FTP Defaults for our Test Plan</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<section name="§-num;.3 Adding FTP Requests" anchor="adding_requests">
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>In our <b>Test Plan</b>, we need to make two <b>FTP requests</b>.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2003-06-12 21:39:42 +08:00
|
|
|
<note>JMeter sends requests in the order that they appear in the tree.</note>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
<p>Start by adding the first <complink name="FTP Request"/>
|
2015-05-01 03:45:36 +08:00
|
|
|
to the FTP Users element (<b>Add</b> → <b>Sampler</b> → <b>FTP Request</b>).
|
2013-07-15 22:17:20 +08:00
|
|
|
Then, select the <b>FTP Request</b> element in the tree and edit the following properties
|
2007-08-21 02:07:53 +08:00
|
|
|
(see Figure §-num;.5):
|
2002-06-20 03:56:21 +08:00
|
|
|
<ol>
|
2013-07-15 22:17:20 +08:00
|
|
|
<li>Change the <i>Name</i> to "File1".</li>
|
|
|
|
|
<li>Change the <i>Remote File</i> field to "/directory/file1.txt".</li>
|
|
|
|
|
<li>Change the <i>Username</i> field to "anonymous".</li>
|
|
|
|
|
<li>Change the <i>Password</i> field to "anonymous@test.com".</li>
|
2002-06-20 03:56:21 +08:00
|
|
|
</ol>
|
|
|
|
|
</p>
|
|
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<note>You do not have to set the <i>Server Name</i> field because you already specified
|
|
|
|
|
this value in the <b>FTP Request Defaults</b> element.</note>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="ftptest/ftp-request.png">
|
2013-07-15 22:17:20 +08:00
|
|
|
Figure §-num;.5. FTP Request for file1</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Next, add the second <b>FTP Request</b> and edit the following properties (see
|
2007-08-21 02:07:53 +08:00
|
|
|
Figure §-num;.6:
|
2002-06-20 03:56:21 +08:00
|
|
|
<ol>
|
2013-07-15 22:17:20 +08:00
|
|
|
<li>Change the <i>Name</i> to "File2".</li>
|
|
|
|
|
<li>Change the <i>Remote File</i> field to "/directory/file2.txt".</li>
|
|
|
|
|
<li>Change the <i>Username</i> field to "anonymous".</li>
|
|
|
|
|
<li>Change the <i>Password</i> field to "anonymous@test.com".</li>
|
2002-06-20 03:56:21 +08:00
|
|
|
</ol>
|
|
|
|
|
</p>
|
|
|
|
|
|
2003-06-13 22:51:51 +08:00
|
|
|
<figure image="ftptest/ftp-request2.png">
|
2013-07-15 22:17:20 +08:00
|
|
|
Figure §-num;.6. FTP Request for file2</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
2007-08-21 02:07:53 +08:00
|
|
|
<section name="§-num;.4 Adding a Listener to View/Store the Test Results" anchor="adding_listener">
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>The final element you need to add to your <b>Test Plan</b> is a
|
2002-06-20 03:56:21 +08:00
|
|
|
<a href="component_reference.html#listeners">Listener</a>. This element is
|
2013-07-15 22:17:20 +08:00
|
|
|
responsible for storing all of the results of your <b>FTP requests</b> in a file and presenting
|
2002-06-20 03:56:21 +08:00
|
|
|
a visual model of the data.</p>
|
|
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Select the FTP Users element and add a <complink name="View Results in Table"/>
|
2015-05-01 03:45:36 +08:00
|
|
|
listener (<b>Add</b> → <b>Listener</b> → <b>View Results in Table</b>).</p>
|
2013-07-15 22:17:20 +08:00
|
|
|
<p>Run your test and view the results.</p>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2013-07-15 22:17:20 +08:00
|
|
|
<figure image="ftptest/ftp-results.png">
|
|
|
|
|
Figure §-num;.7. View Results in Table Listener</figure>
|
2002-06-20 03:56:21 +08:00
|
|
|
|
2001-10-28 21:26:00 +08:00
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</document>
|