0
votes

I have set up a load test plan with multiple thread group, i.e. -

  • Registration (50% of the threads)
  • Place Order (10% of the threads)
  • Some more operations (remaining threads)

Herein if Registration thread does not succeeds than I don't want to execute remaining thread groups. In case of a single thread group I can use if controller and discard samples if one sample fails but how do I achieve it when I am using multiple thread groups.

1
Why do you have to use thread groups? IMO this is a classic case when controllers (e.g. Throughtput controller) provide the same capability, but less complication than thread groups. If you have to use thread groups, this question is basically the same as this: stackoverflow.com/questions/707832/…Kiril S.

1 Answers

1
votes

JMeter Variables scope is limited to current Thread Group only, if you want to use If Controller basing on the condition which is set in another Thread Group - you should be using JMeter Properties instead (JMeter Properties scope is global for the whole JVM). See How to Use Variables in Different Thread Groups article for details on converting JMeter Variables into JMeter Properties.

You may also find InterThread Communication plugins useful when it comes to passing data between thread groups and setting up dependencies.

However, given your scenario you either need to pass the whole thread context (cookies, cache, whatever) which might be tricky so it would be much better putting all the samplers under the same Thread Group and use Throughput Controller, Switch Controller or Weighted Switch Controller, whatever matches your scenario the closest way. See Running JMeter Samplers with Defined Percentage Probability guide for more information.