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
Related
When the parameters are passed via the 'CSV Data Set Config' in the jmeter script, do we have a way of over-writing the values in Azure Load Testing tool,
I have away of externalising the parameters in Jmeter as well, in azure load testing, but when I combine both the values are not over-written
I don't think you can overwrite the JMeter Variable. You can overwrite the value of a JMeter Property so if you use __P() function to define some value in the test you can use user.properties file to give the property its respective value.
At the same time it would be possible to override the default property value via -J command-line argument.
More information:
Configuring JMeter
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide
If you have parameterization implemented via CSV files the only way of amending the values is changing the CSV file itself, in that case you can take a look at awk language and/or sed editor.
I have been trying for weeks now to find a way to handle jmeter script using only single thread group & pass connection variables dynamically by CSV file in which I'm failing terribly. I have multiple value in place of QueueConnection few test cases have message properties as well. I would like to find a way to eternalize is & use single thread group to achieve it.
Check the screenshot an example of variable which should take value dynamically from a file is what I'm expecting.
enter image description here
I don't think you will be able to use CSV file, you will have to go for JMeter Properties instead.
And in the JMS P2P Sampler you need to use __P() function to read the properties values
Something like:
The properties along with their respective values can be:
put into user.properties file like:
queueConnectionFactory=ConnectionFactory
passed via -J command-line arguments like
jmeter -JqueueConnectionFactory=ConnectionFactory
put into a separate .properties file, in this case you will need to "feed" this file to JMeter via -q command-line argument like:
jmeter -q /path/to/your/custom/JMS.properties -t test.jmx ...
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
Full list of command-line options
I am able to successfully run JMeter in master slave configuration in both GUI and non GUI mode when the user defined variables are hardcoded in the test plan. But now I am trying to set these with properties using the
-Gglobal.properties option on master where I have the properties defined in the global.properties file.
Then I am using ${__property(concurrent.threads)} function in the User defined variables.
When I run the remote test I see the property being set to the literal "concurrent.threads" and the test fails to run. The jmeter manual for __property reads:
If the property value cannot be found, and no default has been supplied, it returns the property name
why are the properties not being sent to the slaves, is there a bug in JMeter?
I also tried -Gconcurrent.threads=100 in the command line options and I still get the same behaviour.
Looks like it worked for some other user in 2015 --
How to configure the number of threads to run on slave machines in Jmeter?
In my JMeter master-slave setup, I want to setup a different number of users in each slave for the same thread group.Is it possible to setup with properties file? Is there any other way?
In Load Runner we can configure this easily with Load Generators. How to do in JMeter?
I would recommend doing it as follows:
In your Test Script define number of users using __P() function like ${__P(users,)}
In user.properties file on each slave machine specify the desired number of users like:
users=50
You can also pass the value via -J argument like:
jmeter -Jusers=100 ...
References:
How to do remote testing the 'proper way'?
Apache JMeter Properties Customization Guide
I have recorded a jmeter script for wiki page. That record was done in one of our test environment. That script is working fine and now i want to perform same load test for another test environment(Both environments are same, only urls are different).Is it possible to reuse?How can i do it?
I have added HTTP Request default element at the begging of test plan creation. Now recorded script consist of many HTTP Request element. Each request element contains Server IP of test instance.
Extract IPs and other env-specific data to .properties file:
http://jmeter.apache.org/usermanual/get-started.html#options
Read them in your JMeter with JMeter built-in function ${__P(someName)} as you see fit
Run your generic JMeter test with env-specific config data in .properties file
Yes. It is possible to run the same test in multiple environments. It all depends on how you design your test plan.
This site has exact details you are looking for.
http://www.testautomationguru.com/jmeter-manage-test-plan/