How to Execute JMeter from Command line:
How to Pass Arguments:
In most of JMeter test plans, their will be some dynamic values which will change will different executions like server IP address, admin credentials etc.
So, you will need to pass these dynamic value from command line and use these values in test plan.
So, you will need to pass these dynamic value from command line and use these values in test plan.
Passing Arguments:
jmeter.bat -n -t <test plan name with path> -J<proprtyName>=<argument value>
Example:
jmeter.bat -n -t test_plan.jmx -JserverIP=10.0.0.1
Steps to Use passed argument in JMeter:
- Add a element named 'User Defined Variables' from test plan->add->Config Element as the top element of test plan.
- Go to 'User Defined Variables' element.
- In name field, add name of variable(say var) in which command line argument will be stored.
- In value field, add ${__property(argName)} where argName will be passed from command line.
- For more arguments, repeat steps 3-4.
After execution of above element in jmeter, var will contain the value passed from command line with propery name 'argName'.
No comments:
Post a Comment
Please Comment for Any question or suggestions