FTP Request Using Samplers in JMeter in Testing

In JMeter, Samplers are responsible for performing the actual work. Each sampler can generate one or more sample results except Test Action. The sample results consist of various attributes like success/fail, elapsed time, data size etc. and the result is displayed in the various listeners.

sampler-link.jpg 

FTP Request

The FTP Request controller allows users to send a FTP "retrieve or upload file" request to a FTP server.

ftp-request-controller.jpg
 
If the user wants to send more than one request to the same FTP server then consider using a FTP Default Requests Configuration Element so that the user doesn't need to enter the same information for each and every FTP Request Controller.

ftp-default-request.jpg

Parameters in FTP Request controller

Attribute Description Required
Name Name for this sampler that is shown in the tree. No
Server Name or IP address Domain name or IP address of the FTP server. Yes
Port Port to use. If this is >0, then this specific port is used, otherwise JMeter uses the default FTP port. No
Remote File File to retrieve or name of destination file to upload. Yes
Local File File to upload, or destination for downloads (defaults to remote file name) Yes, if uploading (*)
Local File Contents Provides the contents for the upload, overrides the Local File property. Yes, if uploading (*)
get(RETR) / put(STOR) Whether to retrieve or upload a file. Yes
Use Binary mode Check this to use Binary mode (the default is ASCII) Yes
Save File in Response Whether to store the contents of the retrieved file in the response data. If the mode is ASCII, then the contents will be visible in the Tree View Listener. Yes, if downloading
Username FTP account username. Usually
word FTP account word. N.B. This will be visible in the test plan. Usually