Jmeter - BeanShell

Card Puncher Data Processing

Jmeter - BeanShell

About

Beanshell script in JMeter

Snippet

Log

log.info("Log.info in BeanShell Sampler");

You will see this message in the log

Property

JMeter - Property

props.put("sample_variables","test.id"); 

Variable

JMeter - Variable

// Get the value of one variable
VariableA=vars.get("VariableA")
// Create a new variable from the first one
vars.put("VariableB","myValue"+VariableA); 

Diagnostic

The errors are not shown in a View Result Tree. You have to check the log instead.

Example of errors in the log file:

2013/10/09 14:02:19 ERROR - jmeter.util.BeanShellInterpreter: 
Error invoking bsh method: eval	Parse error at line 2, column 9.  Encountered: ( 
2013/10/09 14:02:19 WARN  - jmeter.modifiers.BeanShellPreProcessor: 
Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	
Parse error at line 2, column 9.  Encountered: ( 





Discover More
Card Puncher Data Processing
JMeter - Property

How to define a property in JMeter. Properties are global to a JMeter instance. This uses the value of the property “loops”, defaulting to 10 if the property is not found. The “loops”...



Share this page:
Follow us:
Task Runner