'Jmeter - How to create re-usable jsr223 sampler

For the purpose of my test, I want to create a re-usable jsr223 sampler (JSR223 Assertion) sampler, so I can just reuse it in multiple HTTP requests. What is the easiest way to achieve that using JMeter, rather than duplication of the same code?



Solution 1:[1]

If you place an Assertion at the same level as Samplers - it will be applied to all of them:

enter image description here

More information: JMeter Scoping Rules - The Ultimate Guide

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T