JMeter - Multiple users reading requests from a directory - jmeter

I have a directory of XML files, and I wanted to configure Jmeter such a way that multiple users(threads) should be able to read the XML files(SOAP requests) concurrently (in a round-robin way or some other way) and submit them to Web Service Endpoint, which means I wanted them to share the input files.. for example if my directory contains 100 XML files then all of my configured users(threads) should share the load and jointly have to process the XML files. (Each user should not process all the 100 files independently).
Is there any way to test the above scenario?
Thanks,
Siva

I believe Directory Listing Config plugin would be the easiest option to use
Just provide path to the directory where your XML files live, configure the plugin according to your test scenario and that's it, you will be able to use just one HTTP Request sampler and refer the file name (or path) as ${filename} where required.
You can install Directory Listing Config plugin and keep it up-to-date via JMeter Plugins Manager.

Related

How to pass properties files to Jmeter server in distributed setup

I have Jmeter distributed setup (One client and one server).
In single jmeter instance I'm using the below command to execute jmeter with a properties file that will pass the user defined variables to my test script
/apache-jmeter-5.3/bin/jmeter -p reco.properties -n -t Performance.jmx -l test2server.csv
When I tried to use the same command including the server configurations I noticed that the values defined in my "reco.properties" are not picked at the test execution.
Instead I need to pass all the variables with "-G" argument. Ex:
/apache-jmeter-5.3/bin/jmeter -GENV=test -n -t Performance.jmx -l test2server.csv
is it possible that I can pass all variables in a properties file for Jmeter Server as I do in the normal execution with "-p"?
Thank you
As per JMeter Documentation:
If the test uses any data files, note that these are not sent across by the client so make sure that these are available in the appropriate directory on each server. If necessary you can define different values for properties by editing the user.properties or system.properties files on each server.
So currently as per JMeter 5.4 this is not supported, you either need to pass the properties one-by-one like -Gprop1=value1 -Gprop2=value2 or to copy the .properties file to all the slave machines
The limitation can be also worked around via getting the properties from a dataabse using JDBC Request sampler or with plugins like HTTP Simple Table Server or Redis Data Set
If you do believe that the feature is essential you can try raising an enhancement request in JMeter Bugzilla

Parameterized file/folder path in Jmeter

Is there any way to parameterized the folder/file path in Jmeter?
When the user uploading it to jenkins or sending to another user it will be very handy if that can be possible
If your test relies on external files (i.e. uses CSV Data Set Config or uploads files using HTTP Request sampler) the good practices is using relative paths, to wit not hard-coding the full path to the folder/file but rather using a relative path to the .jmx file, this way you will be able to transfer the script across machines, use it for distributed testing or in continuous integration servers without having to change anything
Any path can be set via JMeter Property using __P() function, this way you will be able to override the property value using -J command-line argument
If your test data represents a folder with multiple files you might be interested in Directory Listing Config plugin

How can i upload different files per thread in jmeter

I can currently upload a file to a web service using a POST and path of the files.
JMeter 2.13
When running the tests with 1 thread it uploads all the files in the directory to the web service. If I run it with 2 threads it uploads all the files twice.
I want to be able to send x amount random files per thread but don't want to send the same files again.
Any advice on how I can do this without using a CSV file?
I can see at least 2 possible solutions:
Using HTTP Simple Table Server plugin. It has KEEP=FALSE option so the file will be removed from the list after uploading. You can install HTTP Simple Table Server using JMeter Plugins Manager
Use the following approach:
in setUp Thread Group use JSR223 Sampler to copy folder with your test files into a temporary location, the relevant Groovy code will be something like:
org.apache.commons.io.FileUtils.copyDirectoryToDirectory(new File('/path/to/source/folder'), new File('/path/to/destination/folder'))
after file upload request you can delete the file which has already been used in the JSR223 PostProcessor like:
new File('/path/to/the/file').delete()

Jmeter ftp requests with different file names

I am new to the jmeter. I prepared some jmeter scripts to move file from local directory to remote ftp directory. I have succeeded doing this by using jmeter FTP sampler. Now I am facing a challenge in changing the filename every time before I put it in remote directory. I want to process multiple ftp requests with different file names.
Is there any way that I can change the filename in every FTP request before moving to FTP request. jmeter version 2.13.
Thanks,
Ajeesh
Do you have a test plan that looks something like the following?
If you right click on "FTP Request" in the tree in the pane on the left, you can select "Duplicate" to add another FTP request as part of this test plan.
You can change the remote / local file in the pane on the right for the newly added FTP request.
You could use an csv configuration element, this talks about the same problem but for http.
First you need to add an FTP sampler:
And you need to load the file names from a csv configuration file:
.
It will use a CSV entry per each iteration, it will replace the name by the variable ${files}.

JMeter & Mule load testing for file to file test

Is there a way to use JMeter to load test file to file inbound-outbound endpoints in mule? New to JMeter. Does JMeter have this capability or should I look to another framework to do file to file load testing?
I have accomplished this kind of load test before using JUnit and the Mule FunctionalTestCase. I simply create the files I need on my local filesystem under the target/ directory of the Mule application, and observe an output folder also under target/.
This allows me to understand the behavior of the mule application independent of other factors such as disk I/O contention on the server.
To the best of my knowledge, neither JMeter nor LoadUI offers a feature that would allow you to generate large numbers of files, nor to monitor for the output of files.

Resources