Reputation: 187
I have created some test plans in Jmeter. Now I need to run them trough command line or java API.
Can anyone please suggest any links or examples on from CLI/JAVA API how to:
Upvotes: 3
Views: 9490
Reputation: 168157
In addition to previous comment on how to run JMeter in non-GUI mode, number of threads can be passed as JMeter property as follows:
In Thread Group set "Number of Threads" to be ${__property(users,,)}
and set it as
jmeter -Jusers=50 -n -t Test_Plan.jmx -l results_folder\log.jtl
See Apache JMeter Properties Customization Guide for more details.
In regards to running JMeter test from Java code refer to this thread.
For running JMeter scripts from Apache Ant there is JMeter Ant Task
For running JMeter by Maven there is a JMeter Maven plugin
There is also Jenkins plugin if you want to integrate it with Jenkins/Hudson
Upvotes: 9
Reputation: 8346
Now i need to run them trough command line or java API
For running a jmeter test plan through CLI, you want a couple flags --
jmeter -n -t Test_Plan.jmx -l log.jtl
-n
- Non gui mode
-t
location of the test plan
-l
log file to output
Specify number of threads
This is actually built into the test plan - you would want to edit the .jmx test plan to change the number of threads.
Upvotes: 1