Run massively scalable performance tests on web, mobile, and APIs

Request a Demo
Feb. 28th, 2017

Introducing the Directory Listing Config Plugin on JMeter

The Directory Listing Config plugin is a new JMeter plugin (released Feb. 2017), which solves data driven testing needs. Contributed by BlazeMeter’s Java developer Artyom Fedorov, the Directory Listing Config plugin simplifies the iteration over the test data files list. This is done by providing script developers with variables that will get filenames from the source directory, as well as randomizing the iteration order, rewinding iterations, and more.


Until now, JMeter users who wanted to repeat the same tests with different data sets had to either:

1. Take the files they wanted to test from different production environments, rename them so they all have the same name with consecutive numbers, and program their testing script to iterate the chosen file name and the incrementing number, by using Counter Config or ${__counter()} inline function.

2. Create a consolidated table with an organized list of variables to test on your computer and transfer it to JMeter through the CSV Data Set Config.


The problem with these methods is that they take a lot of time and require a lot of painstaking work. In addition, they require preliminary knowledge and research of the number of files to be tested, since they all need to be pre-configured by their filename or into a CSV file, as well as pre-configuring when the iteration should stop. The Directory Listing Config solves these problems.


Who is the Directory Listing Config plugin for?


Anyone who tests multiple files, but especially:

- Developers who test files that need to be uploaded from production to the website or application, like image hosting services.

- AJAX and JSON API testers, who need to test post body requests, which are contained in files and are hard to maintain.


These use cases contain files and variables that are especially hard to pre-configure as they are updated frequently, and that need to be tested in different orders to simulate real user behavior.


How to use the Directory Listing Config plugin


Directory Listing Config Plugin on JMeter


1. Install the plugin through JMeter plugins manager.


2. Define the source directory you want to take the files from as well as the destination variable name you are testing.


3. Customize the iterating parameters:

Use full path - puts the full file path into variable, including the complete file folder hierarchy, instead of only the file name.

Random order - JMeter will shuffle the different variables it tests. This is valuable for examining different performance abilities of your website and app as this simulates real-world scenarios better.

Recursive listing - JMeter will look for the files through all the subfolders and listing structures in the directory. JMeter will find the files itself, without you having to work to find them.

Rewind on end of list - After one loop of testing completes, JMeter runs another one. This is valuable for checking your performance over time. When this is checked with “Random order”, the second and following loops will test the variables in a different order each time.

Re-read directory on end of list - JMeter will go over the directory again to check for new files, before running the iteration again. This makes sure nothing in lost between loops.

Independent list per thread - each thread will go through their own copy of the list. This imitates real-world scenarios. When this is checked with “Random order”, each thread runs its own shuffled list instead of all of them going over the same order of variables.


4. Click ‘Test Directory Listing’ to see if the plugin works with settings provided. You don’t have to run the complete test, as required until now in JMeter, saving time and resources.


Now, use the variable and reveal its real value by adding a Debug Sampler and a View Results Tree listener. That’s it! JMeter will start finding and running the variables, one at a time.


Congratulations! You now know how to work with the new Directory Listing Config plugin. To learn more about advanced JMeter testing, check out this free webinar.

Interested in writing for our Blog? Send us a pitch!