I wanted to start running the same Jmeter test plan but for different scenario i.e. number of users etc. I had setup all the paramters in a user defined variables and changed these between run but this lead to seperate test plan files with different scenarios. The problem any change to the plan other than the variables needed to be replicated across all the test plan. There for I wanted a file that can included in the command line call when invoking Jmeter and at the same time I still wanted the ability to set the paramter via the GUI.
To do this I used the
__P property function. The line below will use the pUser property if it is defined via the command line if it is not ie. from a plan invocation of the GUI it will use the value 20.
Here is an example in a dummy test plan
Next I needed to set up a properties file containing the property / value pairs. In this example I created a file peak.properties with a single line.
Then to run this from the command line I insert the -q peak.properties following to the command line.
jmeter -n -t MyTestPlan.jmx -q peak.properties