There is no "best strategy", it really depends on what you're trying to achieve.

If you're working on a single.jmx file <https://cwiki.apache.org/confluence/display/JMETER/JmxTestPlan> then the "best strategy" is to useTest Fragments <https://jmeter.apache.org/usermanual/component_reference.html#Test_Fragment> and the Module Controller <https://guide.blazemeter.com/hc/en-us/articles/207421345-Using-JMeter-Module-Controller>. The benefit is that if you use a Test Fragment more than once - the module controller acts as a "pointer".

If you have to use multiple .jmx files in your test then the only option is Include Controller <https://jmeter.apache.org/usermanual/component_reference.html#Include_Controller>, but this guy really loads the referenced .jmx script into the main test plan tree and if you reference a .jmx file more than once - there will be multiple copies merged into the main test plan.

On 7/7/2022 4:48 AM, Tong Sun wrote:
Hi,

How do you modularize your JMeter?

I'm thinking that the Include Controller is better than the Module
Controller.

However, for using the Include Controller, it bears the problem of how do
you include other files?

I'm thinking that relative paths are better than absolute paths, as it'll
be more portable.
Also, the Include Controller "*does not support variables/functions in the
filename* field". So it seems that if using the Include Controller
then the relative
paths is the *only *option.

However, that poses another problem that,

jmeter -t path/to/myscript.jmx

will fail.

So, what's the best JMeter Modularisation Strategy?

Reply via email to