Search code examples
oopgroovyjmeterjsr223

Using JSR223 with Groovy in JMeter to run one thread group from within another


Thread Group A: use challenge-response to generate user token. Save as JMeter property. Thread Group B: Run several samplers, one of which uses that token in a header.

Of course, the easy thing to do is run A, then B.

But let's say I want to use a "modular" approach and run only B.

I thought I recall seeing either in SO or Blazemeter that the JMeter object model allows one in a JSR223 Sampler to reference other samplers, even in another thread.

Other ideas also appreciated.


Solution

  • JSR223 Sampler cannot "call" another sampler neither from current nor in another Thread Group.

    The only way of implementing this I can think of is storing the "common" logic as a Test Fragment and calling it where required using Module Controller