JMeter best practices in jmeter

Before this article finishes we are going to write down a couple of very useful tricks and best practices:
  • Although the JMeter UI is a very useful and intuitive tool for configuring and creating different test plans, experience users would like to use the non-GUI mode for executing them and storing their results.
You can do this by typing:
jmeter -n -t test.jmx -l test.jtl.
Assuming test is the test that you want to execute. You have to provide the complete path where your test is stored.
  • Listeners are good to parse results, but they are also resource intensive and consume a lot of memory so it is good to use as few Listeners as possible in your configurations. The flag -l delete them all and it is recommended when listeners are not needed.
  • Check the flag “View only errors” in the results tree view, probably you are only interested in checking what errors occurred during your tests.
  • Use variables and loops in the same sampler instead of configuring several similar samples only differentiated by the variables and parameters that they are using.
  • When creating Junit test plans it is recommended to provide meaningful error and assertion messages so that the JMeter output is as understandable as possible, this is a general recommendation when working with unit tests that applies completely in this case.
  • Using Stop (Control + '.'). This stops the threads immediately if possible.
  • Using Shutdown (Control + ','). This requests the threads to stop at the end of any current work. Other tool tips are available at https://wiki.apache.org/jmeter/JMeterShortcuts.