FTP Test script in JMeter

Apart from HTTP and HTTPS protocols, Apache JMeter also supports FTP protocols. This post will explain to you how to create a JMeter script for an FTP test scenario. Before that let’s figure out the importance of FTP load testing.

Why FTP testing is important?

Load testing of FTP servers is important for determining their capacity and throughput. The performance test checks the impact of the severe load for a prolonged time while transferring the small, medium and large-size files.

How to create an FTP test script in JMeter?

Follow the below steps:

For Uploading the file to the FTP server:

  1. Select the “Test Plan” node
  2. Right-click on the “Test Plan” node
  3. Mouse hovers “Add”
  4. Mouse hovers “Config Element”
  5. Click “FTP Request Defaults”
  6. Provide the FTP server name or IP along with the port number
  7. Again, select the “Test Plan” node
  8. Right-click on the “Test Plan” node
  9. Mouse hovers “Add”
  10. Mouse hovers “Thread Group (Users)”
  11. Click “Thread Group”
  12. Provide the number of threads, loop count etc.
  13. Right-click on “Thread Group”
  14. Mouse hovers “Add”
  15. Mouse hovers “Sampler”
  16. Click “FTP Request”
  17. Provide Remote File, Local File, Local File Contents and Login Configuration
  18. Choose put(STOR)
  19. Again, right-click on “Thread Group”
  20. Mouse hovers “Add”
  21. Mouse hovers “Listener”
  22. Click “View Results Tree”
  23. Run your test by providing No. of users
JMeter FTP Test Script
Figure 01: JMeter – FTP Test Script

For Downloading the file from FTP server:

  1. Select the “Test Plan” node
  2. Right-click on the “Test Plan” node
  3. Mouse hovers “Add”
  4. Mouse hovers “Config Element”
  5. Click “FTP Request Defaults”
  6. Provide the FTP server name or IP along with the port number
  7. Again, select the “Test Plan” node
  8. Right-click on the “Test Plan” node
  9. Mouse hovers “Add”
  10. Mouse hovers “Thread Group (Users)”
  11. Click “Thread Group”
  12. Provide the number of threads, loop count etc.
  13. Right-click on “Thread Group”
  14. Mouse hovers “Add”
  15. Mouse hovers “Sampler”
  16. Click “FTP Request”
  17. Provide Remote File, Local File and Login Configuration. Keep Local File Contents blank
  18. Choose to get(RETR)
  19. Again, right-click on “Thread Group”
  20. Mouse hovers “Add”
  21. Mouse hovers “Listener”
  22. Click “View Results Tree”

You may be interested: