Hi I am passing an email which is a time function like below
email = ${__time(MMddyy)}_${__time(HMS)}@yopmail.com
The value of this functi
Put the following code into the PostProcessor's "Script" area
import org.apache.jmeter.config.Argument;
import org.apache.jmeter.config.Arguments;
Arguments argz = ctx.getCurrentSampler().getArguments();
for (int i = 0; i < argz.getArgumentCount(); i++) {
Argument arg = argz.getArgument(i);
if (arg.getName().equals("email")) {
vars.put("EMAIL", arg.getValue());
break;
}
}
${EMAIL}
where required. Clarification:
email
request parameter (if any) and store it to EMAIL
JMeter Variablectx
- shorthand to JMeterContext class instance vars
= shorthand to JMeterVariables class instanceArguments
and Argument
- you can figure that out from JMeterContext JavaDocSee How to use BeanShell: JMeter's favorite built-in component guide for more information on Beanshell scripting in JMeter.