JMeter – FTP Request

JMeter - FTP Request

Apart from HTTP and HTTPS protocols, Apache JMeter also supports FTP protocol and for which you need to add FTP request sampler in JMeter script. This article will help you to understand, how can you create a script using FTP, FTPS and SFTP test plans using JMeter.

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 create FTP script in Apache JMeter?

Click here to know…

How to add “FTP Request” element?

Follow the below steps:

  1. Select ‘Test Plan’
  2. Right-click on ‘Test Plan’
  3. Hover the mouse on ‘Add’
  4. Hover the mouse on ‘Thread Group (Users)’
  5. Click ‘Thread Group’
  6. Right-click on ‘Thread Group’
  7. Hover the mouse on ‘Add’
  8. Hover the mouse on ‘Sampler’
  9. Click ‘FTP Request’
JMeter - FTP Request
Figure 01: FTP Request

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

‘FTP Request’ sampler has the below inputs:

  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. No need to provide again if you have already provided in FTP Request Default element.
  4. Port Number: FTP server port number. Default FTP server port is 21 unless configured on the different port. No need to provide again if you have already provided in FTP Request Default element.
  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. 
  6. Local FileThe 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. 
  7. Local File Contents: The source file content can be provided using this input when the file is uploaded.
  8. get(RETR): Choose to download the file from the FTP server.
  9. put(STOR)Choose to upload the file to the FTP server. 
  10. Use Binary mode: 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. Login Configuration: FTP server credentials need to be provided here.

Some Important Tips:

  • Use FTP Request under Thread Group
  • Add FTP Request Default element under Test Plan where FTP server name or IP is provided
  • Provide Remote file and Local file value in ‘FTP Request’ instead of ‘FTP Request Default’
  • Some common error: HTTP 530 (Invalid Credential), HTTP 550 (Invalid File Path)

Leave a Reply

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