FTP Sampler – Jmeter

This controller lets you send an FTP “retrieve file” or “upload file” request to an FTP server. If you are going to send multiple requests to the same FTP server, consider using a FTP Request Defaults Configuration Element so you do not have to enter the same information for each FTP Request Generative Controller. When downloading a file, it can be stored on disk (Local File) or in the Response Data, or both.

There are many anonymous ftp sites in the web. Just search in Google as “FTP sites” or “Anonymous FTP sites” and you will get a good list of ftp sites which you can connect to. But if you are unable to connect to one of them due to firewall you can set up your own FTP Server. Download free FTP server from www.goldenftpserver.com/golden-ftp-server.zip and install it with default settings in your system.

Share a file in your server (Open shares->Add).Also share a Folder (enable full control) in your server and name it as Add.

ftp11

Select a share and click info and it will show the access path to the file.

ftp2

You can connect to this file from another system of your network (if only firewall is disabled) through command prompt (ftp 172.26.3.206).Once it is connected you can check the connections to your server.

In this example we are testing a server hosted in the same system.

1. Open a new Test plan in Jmeter and under add a thread group under it. Add two FTP Request Samplers to it. The first sampler is used foe retrieving a file from FTP server and second is for uploading a file to it.

2 .Give server name as localhost (you can also mention the IP).Remote file is given as it is shown in the server and local file is the name under which it will be stored after it gets retrieved. Select get(RETR) option. Enter Login Configurations as required (here anonymous/ anonymous).

ftp3

Similarly for second sample configure the settings. Here Local file is the file to be uploaded in FTP server (give full path of this file).Remote file is how it will be uploaded into the server (here it will be uploaded in Add folder).Select put (STOR) option.

ftp4

Now run the test and view results in Results tree listener. If the test is successful the retrieved file is stored in bin folder.

ftp5

FAILURE MESSAGES:

Response code: 550

Response message: 550 Operation not complete

This means that the path where file is to be uploaded is not modifiable. (Should enable full control)

Advertisements

One Response

  1. Hi,

    I didnot understand the setting for the Uploading a file section also the picture is not very clear, please provide the last two snapshots in better view also explai the settings tab by tab.

    Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: