JMeter – JSR223 PostProcessor

In JMeter, JSR223 PostProcessor is a scripting-based post-processor. JSR stands for Java Specification Requests. As same as BeanShell PostProcessor which we discussed earlier; you will need to implement the post-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 PostProcessor. 

JMeter - JSR223 PostProcessor
Figure 01

How to add ‘JSR223 PostProcessor’?

Follow the below steps to add ‘JSR223 PostProcessor’:

  1. Select the appropriate element where you want to add the post-processor
    1. Test Plan
    2. Thread Group
    3. Controller
    4. Sampler
  2. Right-click on the element
  3. Hover the mouse on ‘Add’
  4. Hover the mouse on ‘Post Processors’
  5. Click ‘JSR223 PostProcessor’

What are the input fields of ‘JSR223 PostProcessor’?

‘JSR223 PostProcessor’ has the following input fields:

  1. Name: To provide the name of the post-processor
  2. Comments: To provide arbitrary comments (if any)
  3. Language: To choose the scripting language. 
JMeter - JSR223 PostProcessor
Figure 02
  1. Parameters: Parameters to pass to the script. This is an optional attribute.  
  2. Script file: A file containing the script to run. The return value is the desired output.
  3. 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)
  4. Script: The manual script which contains the post-processing logic.

Use of JSR223 PostProcessor:

To exclude a particular sampler’s response time from the transaction response time. Click here to know in detail.

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:

Leave a Comment