Sometimes I need to modify some parameters in the Test Plan and it requires me to start JMeter, open the Test Plan file and edit these parameters there. But it's better to use JMeter properties for this task. Look at the image below.
There are JMeter properties used as values of "Number of Threads (users)" and "Loop Count" options: ${__P(users)} and ${__P(count)}. Also we must add two parameters to JMeter command line:
jmeter -t TestPlan.jmx -Jusers=10 -Jcount=50
Now you can specify necessary parameters on the fly. I recommend you to use properties for the following options: number of users, loop count, host, port, results and data filenames, etc.
We're new to jmeter and this is an eye-opener in terms of being able to automate it; thanks for this post!
ReplyDeleteAwesome Really ! ...Saurabh
ReplyDeleteVery helpful..Thanks
ReplyDeleteHi very help full but how can I replace the endless bucle? Thanks
ReplyDeletenice,thx
ReplyDeleteThank you, was wasting time trying to set a variable from the command line.
ReplyDeleteSurprised me greatly... useful tip
ReplyDeleteDoes this work in non-GUI mode, meaning when i start JMeter with jmeter-n.cmd?
ReplyDeleteYes, it does.
DeleteIs there a way to set as a property file? Thanks
ReplyDeleteYou can specify any value as a property, i.e. integer number, floating-poing number, string, etc. There are no limitations.
DeleteHi Victor,
ReplyDeleteI have a question, can I re-read the value in properties file without restarting jmeter? For example, I have started jmeter by the command 'jmeter -nt sms.jmx -p sms.properties', but I want to change the value in the property file when jmeter is still running. Can jmeter read the new value without being restarted? Thank you in advance.
BR
/Lisa
I'm not sure that this is possible. You can try to use __setProperty function for changing the property value at runtime.
DeleteHi Victor,
ReplyDeleteI have provide
Number of Threads(users) - ${__P(users)}
Ramp-up Period(in seconds) - 1
Loop Count: Forever
and did Scheduler Configuration where my Start time and Start date were past and provide the duration as 300.
I expect my request to run for 300 seconds and to generate 300 requests. But it generated only one request.
Now as option2 i have proivded my loopcount as 300 but stil only one request was run.
As a last option i wanted my threads to run for 300 seconds, so i have set
Number of Threads(users) - 1
Ramp-up Period(in seconds) - 1
Loop Count: 300
I expect 300 requests should run for 300 seconds, but they got run in just 3 to 4 seconds.
Any help
Number of Threads(users) - 300
DeleteRamp-up Period(in seconds) - 1
Loop Count: 1
Does it make sense?
Thank you very much! This is very helpful!!!
ReplyDeleteThis is what I was looking for. Thanks dude.
ReplyDelete