JMeter – FTP Request Defaults

JMeter - FTP Request Defaults

Apart from HTTP and HTTPS protocols, Apache JMeter also supports FTP protocol. This article will show how can you create FTP, FTPS and SFTP test script using JMeter FTP Request Defaults element.

Why FTP testing is important?

Load testing of FTP servers is important for determining their capacity, measuring throughput, checking the impact of the severe load for a prolonged time while transferring the small, medium and bulky file.

How to add ‘FTP Request Defaults’ element in JMeter script?

You can follow below steps:

  1. Select ‘Test Plan’ node
  2. Right-click on the ‘Test Plan’ node
  3. Hover the mouse on ‘Add’
  4. Hover the mouse on Config Element
  5. Click ‘FTP Request Defaults’
JMeter - FTP Request Defaults
Figure 01

What are the input fields of ‘FTP Request Defaults’?

JMeter - FTP Request Defaults
Figure 02
  1. Name: To provide element name
  2. Comments: To provide arbitrary comments (if any)
  3. Server Name or IP: FTP server hostname or IP address. This is the server from/to where you need to get/put the file.
  4. Port Number: FTP server port number. Default FTP server port is 21 unless configured on a different port.
  5. Remote File: The path to the file on the FTP server, which will be downloaded or used as a destination path for file upload. Generally, keep it blank. Use only in that case when the file is globally declared.
  6. Local File: The path to the file on the local file system (where JMeter is running), which will be uploaded to the FTP server or to where the remote file is stored locally. Generally, keep it blank. Use only in that case when the file is globally declared. 
  7. Local File Contents: The source file content can be provided using this input when file is uploaded.
  8. get(RETR): Choose to download the file from the FTP server.
  9. put(STOR)Choose to upload file to the FTP server. 
  10. Use Binary mode: This option instructs whether to use “binary” mode for file transfers. If you are uploading/downloading plain text files, then unchecked this box otherwise keep this checked in all cases
  11. Save File in Response: If this box is checked (in case of “get(RETR)” requests) retrieved file content will be stored as the FTP Request sampler Response Data (so it can be visualized and used in Post-processors and Assertions)

Some Important Tips:

  • Use FTP Request Defaults under Test plan only
  • Provide FTP server name or IP along with the port number
  • Keep Remote file and Local file field as blank unless you do not use their value as global
  • get(RETR) and put (STOR) setting will be overridden by FTP request sampler

How to create an FTP script in Apache JMeter?

Refer to the article: Link


Leave a Reply

Your email address will not be published. Required fields are marked *