My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Functions  
Updated May 1, 2012 by a...@apc.kg

Additional Functions

In addition to standard JMeter functions we provide:

doubleSumsince 0.4.2

This function used to compute the sum of two or more floating point values.

Parameters:

  1. First value to sum - required
  2. Second value to sim - required
  3. More values to sum - optional
  4. Last argument - variable name to store the result

Example, returning 8.3 and also saving it to variable sumVariable:

${__doubleSum(3.5, 4.7, sumVariable)}

strLensince 0.4.2

This function used to compute the length of constant string or variable value.

Parameters:

  1. First value is string constant, variable, or function call - required
  2. Second argument - variable name to store the result

Example, returning 11 and also saving it to variable lenVariable:

${__strLen(test string, lenVariable)}

Example, returning length of variable varName:

${__strLen(${varName})}

uppercase and lowercasesince 0.4.2

This functions used to transform the case of constant string or variable value.

Parameters:

  1. First value is string constant, variable, or function call - required
  2. Second argument - variable name to store the result

Example, transforming 'test' into 'TEST' and also saving it to variable someVariable:

${__uppercase(test, someVariable)}

MD5since 0.4.2

This function used to calculate MD5 hash of constant string or variable value.

Parameters:

  1. First value is string constant, variable, or function call - required
  2. Second argument - variable name to store the result

Example, calculating MD5 for 'test':

${__MD5(test)}

isDefinedsince 0.4.2

This function used to determine if variable was already defined. Returns 1 if variable was defined, 0 instead.

Parameters:

  1. First value is string constant, variable, or function call - required

Example, getting defined status for variable name 'testVar':

${__isDefined(testVar)}

substringsince 0.4.2

This function is wrapper for Java String.substring method.

Parameters:

  1. First value is string constant, variable, or function call - required
  2. Begin index
  3. End index
  4. Optional variable to store result

Example, getting 'str' from 'test string':

${__substring(test string, 5, 8)}
Comment by manga...@gmail.com, Oct 11, 2011

A function for base 64 encode and decode would be nice to have, so as not to need to rely on external code to use with JMeter.

And perhaps also function to decrement a value - opposite of intSum and counter

Powered by Google Project Hosting