Reputation: 4742
We're using JMeter to load test our application. Currently, whenever there is a change in the request body and headers, I need to open the JMeter UI, save the test plan, then execute this plan using jmeter command.
Is there any way the test plan modification can happen without the requirement of opening the JMeter UI and modifying it? So that I can directly run the jmeter command with the changes without having to open the UI.
Or is there any other application which facilitates this?
Upvotes: 1
Views: 110
Reputation: 168122
You can configure JMeter to read the request body from the file using __FileToString() function like:
You can use __P() function for each value you want to parameterize like:
Once done you will be able to pass the properties via -J
command-line argument as:
jmeter -Jheader.name.1=Content-Type -Jheader.value.1=applicatino/json -Jheader.name.2=Host -Jheader.name.2=example.com etc.
There is __CSVRead() function which can fetch values from the comma-separated-value files
-q
command-line argument and specify your changed values there, the values can be read using the aforementioned __P() function
Check out Apache JMeter Functions - An Introduction article to learn more about JMeter Functions concept.
Upvotes: 2