Apart from HTTP and HTTPS protocols, Apache JMeter also supports FTP protocol and for which you need to add an FTP request sampler in the 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, and checking the impact of the severe load for a prolonged time while transferring small, medium and bulky files.
How to create an FTP script in Apache JMeter?
How to add the “FTP Request” element?
Follow the below steps:
- Select ‘Test Plan’
- Right-click on ‘Test Plan’
- Hover the mouse on ‘Add’
- Hover the mouse on ‘Thread Group (Users)’
- Click ‘Thread Group’
- Right-click on ‘Thread Group’
- Hover the mouse on ‘Add’
- Hover the mouse on ‘Sampler’
- Click ‘FTP Request’
What are the input fields of the ‘FTP Request’ element?
‘FTP Request’ sampler has the below inputs:
- 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. No need to provide it again if you have already provided in FTP Request Default element.
- Port Number: FTP server port number. The default FTP server port is 21 unless configured on a different port. No need to provide it again if you have already provided it in FTP Request Default element.
- Remote File: The path to the file on the FTP server, which will be downloaded or used as a destination path for file upload.
- 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.
- 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: 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
- 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 errors: HTTP 530 (Invalid Credential), HTTP 550 (Invalid File Path)
You may be interested:
- Performance Testing Tutorial
- Performance Engineering Tutorial
- Micro Focus LoadRunner Tutorial
- NeoLoad Tutorial