JMeter – FTP Request Defaults
Apache JMeter supports the FTP protocol in addition to HTTP and HTTPS. This article shows you how to use the JMeter FTP Request Defaults element to generate FTP, FTPS, and SFTP test scripts.
Why are FTP tests important?
FTP servers must be load tested to determine capacity, measure performance, and assess the effects of heavy load over an extended period of time when transferring small, medium, and large files.
How to add ‘FTP Request Defaults’ element in JMeter script?
- Select the ‘Test Plan’ node
- Right-click on the ‘Test Plan’ node
- Hover the mouse on ‘Add’
- Hover the mouse on Config Element
- Click ‘FTP Request Defaults
What are the input fields of ‘FTP Request Defaults’?
1. Name: specify the name of the element
2. Feedback – to provide random feedback (if any)
3. Server Name or IP: FTP server hostname or IP address. This is the server from/where you need to fetch/put the file.
4. Port number: Port number of the FTP server. The default FTP server port is 21 unless it is set to a different port.
5. Remote File: The path to the file on the FTP server that will be downloaded or used as the destination path for uploading files. Generally keep it empty. Use it only in that case when the file is declared globally.
6. Local File: The path to the file on the local file system (where JMeter is running) that will be uploaded to the FTP server or where the remote file will be stored locally. Generally keep it empty. Use it only in that case when the file is declared globally.
7. Local File Content – 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 – This option specifies whether to use the “binary” mode for file transfers. If you are uploading/downloading plain text files, uncheck this box; otherwise, leave it checked in all cases
11. Save the file in response: If this box is checked (in the case of “get(RETR)” requests), the content of the retrieved file will be saved as response data from the FTP request sampler.
Some vital tips
• Use only the FTP request defaults from the test plan.
• Specify the port number and the name of the FTP server or IP.
• Keep the Remote File and Local File fields empty unless you want to use them because the FTP request sample overrides any global get (RETR) and transfer (STOR) settings.