Apart from HTTP and HTTPS protocols, Apache JMeter also supports FTP protocols. This article will show how can you create FTP, FTPS and SFTP test scripts using the JMeter FTP Request Defaults element.
Why FTP testing is important?
Load testing of FTP servers is important for determining their capacity, measuring throughput, and checking the impact of the severe load for a prolonged time while transferring small, medium and bulky files.
How to add the ‘FTP Request Defaults’ element in the JMeter script?
You can follow below steps:
- 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’?
- Name: To provide element name
- Comments: To provide arbitrary comments (if any)
- Server Name or IP: FTP server hostname or IP address. This is the server from/to where you need to get/put the file.
- Port Number: FTP server port number. The default FTP server port is 21 unless configured on a different port.
- 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.
- 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.
- Local File Contents: The source file content can be provided using this input when the file is uploaded.
- get(RETR): Choose to download the file from the FTP server.
- put(STOR): Choose to upload the file to the FTP server.
- Use Binary mode: This option instructs whether to use the “binary” mode for file transfers. If you are uploading/downloading plain text files, then unchecked this box otherwise keep this checked in all cases
- 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 the Test plan only
- Provide the FTP server name or IP along with the port number
- Keep the Remote file and Local file fields blank unless you do not use their value as global
- get(RETR) and put (STOR) setting will be overridden by the FTP request sampler
How to create an FTP script in Apache JMeter?
Refer to the article: Link