How to read set of files from a directory in JMeter

This articles discusses about reading set of files from a directory without repeating any of them.

For this scenario I’m using following use case.

Use case: Jmeter as the Jms Publisher which publishes separate files of messages(20) to the Topic(games) which resides in WSO2 MB.

Prerequisites

  • Configure a Topic in WSO2 MB.

Install Directory Listing Config in JMeter

  • Download jmeter-plugins-manager-1.3.jar from here.

Configurations

  • Start Jmeter by sh jmeter.sh
Image for post
Image for post
  • Click on Test Directory Listing. This will show the set of files which are read from this Config Element.
Image for post
Image for post
  • Add a Thread group and under that JMS Publisher.
Image for post
Image for post

File: ${file} This will read the current file which is selected from the Directory Listing Datasource

Initial Context Factory, Provider URL, Destination: These are related to WSO2 Topic Configurations

  • In this Thread Group do the following configuration which says how many iterations this needs to be invoked. I have 20 files that is 20 requests to be sent. Therefore I used 20 as the loop count.
Image for post
Image for post
  • Run the Test plan and the result will be as below.
Image for post
Image for post

Written by

Senior Software Engineer — QA at WSO2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store