Class RandomDate

java.lang.Object
org.apache.jmeter.functions.AbstractFunction
org.apache.jmeter.functions.RandomDate
All Implemented Interfaces:
org.apache.jmeter.functions.Function

@AutoService(org.apache.jmeter.functions.Function.class) public class RandomDate extends org.apache.jmeter.functions.AbstractFunction
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.
Since:
3.3
  • Constructor Details

    • RandomDate

      public RandomDate()
  • Method Details

    • execute

      public String execute(org.apache.jmeter.samplers.SampleResult previousResult, org.apache.jmeter.samplers.Sampler currentSampler) throws org.apache.jmeter.functions.InvalidVariableException
      Specified by:
      execute in interface org.apache.jmeter.functions.Function
      Specified by:
      execute in class org.apache.jmeter.functions.AbstractFunction
      Throws:
      org.apache.jmeter.functions.InvalidVariableException
    • setParameters

      public void setParameters(Collection<org.apache.jmeter.engine.util.CompoundVariable> parameters) throws org.apache.jmeter.functions.InvalidVariableException
      Specified by:
      setParameters in interface org.apache.jmeter.functions.Function
      Specified by:
      setParameters in class org.apache.jmeter.functions.AbstractFunction
      Throws:
      org.apache.jmeter.functions.InvalidVariableException
    • getReferenceKey

      public String getReferenceKey()
      Specified by:
      getReferenceKey in interface org.apache.jmeter.functions.Function
      Specified by:
      getReferenceKey in class org.apache.jmeter.functions.AbstractFunction
    • getArgumentDesc

      public List<String> getArgumentDesc()