Package org.apache.jmeter.functions


package org.apache.jmeter.functions

Functions

Methods to be implemented

setParameters(Collection)
execute(prevResult,currentSampler) Note that either or both of the parameters may be null.

Calling sequence

When the test plan is prepared for running, one instance of the class is created for each occurrence of a function call. The setParameters() method is then called on each instance. Once the test is running, the execute method can be called by any thread, and is therefore synchronized. This is unlike most of (all?) the JMeter test elements, which are created for each thread. Any context that needs to be maintained for a thread must be done using ThreadLocal or similar.
  • Class
    Description
    Provides common methods for all functions
    A function which understands BeanShell
    Change Case Function Support String manipulations of: upper case lower case capitalize
    ChangeCase Modes Modes for different cases
    Function to generate chars from a list of decimal or hex values
    The function represented by this class allows data to be read from CSV files.
    DateConvert function to change date format Can optionally store it in a variable.
    Digest Encode Function that provides computing of different SHA-XXX, can uppercase the result and store it in a variable.
    Function which escapes the characters in a String using HTML entities.
    Escape ORO meta characters
    Function which escapes the characters in a String using XML 1.0 entities.
    Function to evaluate a string which may contain variable or function references.
    Function to evaluate a string which may contain variable or function references.
    File data container for CSV (and similar delimited) files Data is accessible via row and column number
    FileToString Function to read a complete file into a String.
    This class wraps the FileRowColContainer for use across multiple threads.
    Methods that a function must implement
    __groovy function Provides a Groovy interpreter
    Provides an intSum function that adds two or more integer values.
     
    Test if a JMeter property is defined
    Test if a JMeter variable is defined
    Counter that can be referenced anywhere in the Thread Group.
    javaScript function implementation that executes a piece of JavaScript (not Java!) code and returns its value
    A function which understands Commons JEXL2
    A function which understands Commons JEXL3
    Function to log a message.
    Function to log a message.
    Provides a longSum function that adds two or more long values.
    Return Machine IP
    Return Machine Host
    Function to get a JMeter property, and optionally store it Parameters: - property name - variable name (optional) - default value (optional) Returns: - the property value, but if not found: - the default value, but if not defined: - the property name itself
    Function to get a JMeter property, or a default.
    Provides a Random function which returns a random long integer between a min (first argument) and a max (second argument).
    RandomDate Function generates a date in a specific range Parameters: Time format @see DateTimeFormatter (optional - defaults to yyyy-MM-dd) Start date formated as first param (optional - defaults to now) End date Locale for the format (optional) variable name (optional) Returns a formatted date with the specified number of (days, month, year) Value is also saved in the variable for later re-use.
    Provides a RandomFromMultipleVars function which returns a random element from a multi valued extracted variable.
    Provides a RandomString function which returns a random String of length (first argument) using characters (second argument)
    Implements regular expression parsing of sample results and variables
    Function to return the name of the current sampler.
    Function to set a JMeter property Parameters: - property name - value Usage: Set the property value in the appropriate GUI by using the string: ${__setProperty(propname,propvalue[,returnvalue?])} Returns: nothing or original value if the 3rd parameter is true
    Function to split a string into variables
    StringFromFile Function to read a String from a text file.
    StringToFile Function to write a String to a file Parameters: file name content append (true/false)(optional) file encoding (optional) Returns: true if OK, false if an error occurred
    Returns Test Plan name
    Returns Thread Group Name
    Function to return the current thread number.
    __time() function - returns the current time in milliseconds
    timeShifting Function permit to shift a date
    Function to unescape any Java literals found in the String.
    Function to unescape a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
    Function to decode a application/x-www-form-urlencoded string.
    Function to encode a string to a application/x-www-form-urlencoded string.
    Function to create a UUID Parameters: - None Returns: - A pseudo random UUID 4
    Function to get a JMeter Variable Parameters: - variable name - default value Returns: - the variable value, but if not found - the default value if set, and if not the variable name itself
    The function represented by this class allows data to be read from XML files.
    File data container for XML files Data is accessible via XPath