JMeter – BeanShell PreProcessor
A script-based preprocessor in JMeter is called the BeanShell PreProcessor. It means that you can use any of the supported scripting languages to build the preprocessor logic yourself. It’s usually useful when you need to build logic according to your needs and want to write a special algorithm that JMeter doesn’t provide yet. Using the BeanShell PreProcessor you can implement your own algorithm.
How can I add ‘BeanShell PreProcessor’ to JMeter?
Choose the element that corresponds to the Preprocessor
- Test the plan that you want to add.
- Sampler for Thread Group Logic Controllers
- Right-click on the component.
- Mouse over ‘Add’
- ‘Preprocessor’ is highlighted when you mouse over it.
- Select ‘BeanShell Preprocessor’.
Which input fields are there?
Name: To specify the timer’s name
Please leave arbitrary remarks, if any.
Reset the bus. Before each call, the interpreter: Selecting the ‘Yes’ option for this option will result in the creation of a new interpreter.
Parameters: To be passed to the BeanShell script as parameters. This quality is optional.
Text file: a file with the BeanShell script that needs to be executed. The return value from the BeanShell script is used as a preprocessing output.
PreProcessor Logic is contained in the BeanShell script.