Jmeter - BeanShell

1 - About

Beanshell script in JMeter

3 - Snippet

3.1 - Log


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

You will see this message in the log

3.2 - Property

JMeter - Property


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

3.3 - 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); 

4 - 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: ( 


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap