JSR223 PreProcessor is a scripting-based pre-processor of JMeter. JSR stands for Java Specification Requests. As same as BeanShell PreProcessor which we discussed earlier; you will need to implement the pre-processing logic by yourself using one of the supported scripting languages like Groovy, BeanShell, java, javascript, jexl etc. Usually, it is helpful when you need to write custom code based on some unique algorithm which is not currently provided by JMeter. You can create your own implementation of the code using JSR223 PreProcessor.
How to add ‘JSR223 PreProcessor’?
You can follow the below steps:
- Select the appropriate element where you want to add the preprocessor
- Test Plan
- Thread Group
- Controller
- Sampler
- Right-click on the element
- Hover the mouse on ‘Add’
- Hover the mouse on ‘Pre Processors’
- Click ‘JSR223 PreProcessor’
What are the input fields of ‘JSR223 PreProcessor’?
‘JSR PreProcessor’ has the following inputs:
- Name: To provide the name of the preprocessor
- Comments: To provide arbitrary comments (if any)
- Language: To choose a scripting language.
- Parameters: Parameters to pass to the script. This is an optional attribute.
- Script file: A file containing the script to run. The return value is the desired output.
- Script compilation caching: Unique String across Test Plan that JMeter will use to cache the result of script compilation if the language used supports a Compilable interface (Groovy is one of these, java, BeanShell and javascript are not)
- Script: The manual script which contains the pre-processing logic.
Recommendation: It is recommended to use JSR223 test elements and Groovy as a language for any scripting. Groovy scripting is as fast as Java while BeanShell and JavaScript need to be interpreted, which causes some performance overhead.
You may be interested:
- Performance Testing Tutorial
- Performance Engineering Tutorial
- Micro Focus LoadRunner Tutorial
- NeoLoad Tutorial