In this section, you will learn how to test an FTP site by creating a basic Test Plan. For example, you will create 4 users who sends requests for 2 files on anFTP site. You will request the users to run the test couple times. Hence there will be a total of 16 (4 users * 2 requests * 2 times) FTP requests.

Adding Users

To start with, the very first step is to add a Thread group element as it instructs Jmeter the total number of user we’re trying to stimulate, how many requests the users need to send and when the users should send requests.

In order to add the ThreadGroup element, Click on the Test Plan, then Add and then select Add à ThreadGroup. Make sure you see this Thread Group element by expanding the Test Plan tree on the Test Plan element.

Next step is to change the default properties. Expand the Test Plan and click on the Thread Group and this will display all the default properties of the Thread Group.

Thread Group with Default Values

  • Give a descriptive name to your Thread Group. Let’s name it FTP users. When you change the name, please notice that your Thread group name changes under the Test Plan tree
  • Set the number of users to 4
  • Set the ramp up period to 1 second. This means that, your Jmeter will have a 1 second ramp up period to start all of the 4 users.
  • Set the Loop count to 2. This instructs the Jmeter, the number of times the test needs to be run. In case if you would like to repeatedly run this test plan, then select the Forever checkbox.

FTP Users Thread Group

The above figure shows the new values of FTP Users Thread Group

Adding FTP Request Properties

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 FTP requests to perform. For now, you will leave the default settings as it is for the FTP requests. Then you will add FTP Request elements.

Right Click on the FTP users element under the Test plan, then choose Add, Config element and then FTP Request Defaults. In order to view this control panel, click on this new element.

FTP Request Defaults

From the FTP Request Defaults Control panel, you can leave the name to be as it is.

Set the Server Name or IP to This means that, all your FTP requests will be sent to this Server Name or IP

Now an FTP Request Defaults will be created with all the details that you have mentioned in the control panel.

FTP Defaults for our Test Plan

Adding FTP Requests

In our Test Plan, we need to make two FTP requests.

We will be creating two FTP requests File 1 and File 2 in our Test Plan

Requests are being sent in the same order that you have added them in the tree.

In order to add the FTP Request, Right click on the FTP Users and then Click on Add, Sampler and then FTP Request. Now click on the FTP Request element in the build ftp test plan tree and then edit the field values

  • Set the FTP Request Nameto File1.
  • Set the Remote File value to directory/file1.txt
  • Set the Usernameto “anonymous”.
  • Set the Passwordfield to “”.

The Server name is already been set in the FTP Request Defaults element, hence you need not set one here.

FTP Request for file1

Similarly add and edit the Second FTP Request as follows:

  • Set the FTP Request Nameto File2.
  • Set the Remote File value to directory/file2.txt
  • Set the Usernameto “anonymous”.
  • Set the Passwordfield to “”.

FTP Request for file2

Adding a Listener

The last step is to add a Listener to the test plan. Listener helps to view/store the FTP request’s test results in a file and show the results.

Adding the listener can be done by Right click on the FTP Users element, then click on Add, Listener and then View Results in Table. View Results in Table instructs the Listener to display the results in a Tabular Form.

Now save all the changes of the test plan and run your test by clicking on Menu, Run and then Start. Alternatively, as a shortcut, you can also CTRL+R in your Keyboard to run the test.

The listener will show the results like below

View Results in Table Listener