How to Test FTP Upload and Download

To Demonstrate an FTP upload and Download we need an FTP website where we should have access. I have a sample FTP website where everybody can have access.

Once you navigate to that website, you will find the below page: ftp-test-website-jmeter

  • On the above page, we have a username and password, by using these details we can connect to the FTP website.
  • We can connect to the FTP site either by using a WinSCP client or Filezilla.
  • I am connecting using WinSCP.
  • Before that download and Install WinSCP in your system.
    installing-winscp-in-system-jmeter
  • After the successful installation of WinSCP, you will find the login page as below.
    winscp-login-page-jmeter
  • Click on the file Protocol and select FTP.
    select-ftp-from-file-protocol-jmeter
  • Next, enter the Hostname which is present in the dlptest website, and enter the given username and password.
    click-on-login-button-jmeter
  • Click on the Login button.
  • Once you click on the Login button, WinSCP will connect to the FTP.
  • Here you can drag and drop files from Local system to FTP or From FTP to Local System.
  • Let us go to the JMeter and we need to enter some connection details.
    add-ftp-request-to-thread-group-jmeter
  • Next, you need to enter all the connection details on the FTP page as shown below. Enter the Server name as ftp.dlptest.com.
    server-name-in-jmeter
  • Next, go to the WinSCP and create a new file by clicking on the New.
    creating-new-file-jmeter
  • After creating a new .txt file, enter some texts inside the text file as shown below.
    text-txt-file-created-jmeter
  • After creating a file, go to the remote file location and refresh WinSCP, you will find the Text.txt file as below.
    test-txt-file-inside-winscp-jmeter
  • Next, go to the JMeter and enter the file name in the Remote File and then enter the Local file location followed by a newly created file name in the JMeter, and enter the Username and Password of the FTP account.
    ftp-request-details-jmeter
  • These are the details which we have to give in the JMeter, Save the test plan.
  • Next, add View Result Tree listener to the Thread Group.
  • Save and Run the Thread Group, after successful execution the test.txt file has been downloaded to our local system.
    successfull-execution-of-ftp-request-jmeter
  • The Test.txt file has been downloaded in the given location.
    test-file-present-in-local-system-jmeter

Challenges I have faced in this while Downloading the File from WinSCP to Local System is:

  • Sometimes the local drive does not support them to access remote file locations, in that case, change the local system location.

Uploading File to FTP Server with JMeter

  • Delete the Test.txt file which is present inside the remote location.
    deleting-test-txt-file-in-remote-location-jmeter

  • Go to the JMeter and select the put(STOR) in the FTP request and then save and run the thread group.
    select-put-location-inside-the-FTP-request-jmeter
  • After the successful execution, the Test.txt file will be uploaded into the remote location.
    test-txt-file-has-uploded-inside-remote-location-jmeter

Save File Response With FTP in JMeter

  • In the same way, you can save the file in the Response by selecting the Save file Response option in the FTP Request inside the JMeter.
  • Delete the test.txt File in the Local system and then select the Get option in the FTP request in the JMeter.
    delete-the-file-inside-the-local-system-jmeter
    select-get-option-and-save-file-response-jmeteer
  • Now save and run the Thread Group. After execution, the Test.txt file has been downloaded into the Local systems and then the same file has been saved inside the Response.
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions