Social Icons

Pages

Tuesday 7 October 2014

JMeter best practices

JMeter has some limitations especially when it is run in a distributed environment. Following these guidelines will assist in creating a real and continuous load:
  • Use multiple instances of JMeter in case the number of threads are more.
  • Check the Scoping Rules and design accordingly.
  • Use naming conventions always for all elements.

How to pass command line arguments to JMeter when executed from command line

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.

How to reference variables and functions in JMeter

While writing test plans in JMeter, you will need to use many variables to store some values like command line arguments, random values etc. and different functions to perform different operations.

Referencing variables:
In JMeter, variables are referenced with curly braces and $(dollar sign) i.e. a variable with name var will be referenced as ${var}.

Function in Apache JMeter

JMeter functions are no different from normal languages like C, C++, Perl etc. These functions take some parameters and return some value after processing those arguments. By convention, JMeter function names always starts with '__' i.e. two underscores. 

A typical function call looks like: