You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tong Sun <su...@gmail.com> on 2022/07/07 02:48:33 UTC

JMeter Modularisation Strategy

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?

Re: JMeter Modularisation Strategy

Posted by Dmitri T <gl...@live.com>.
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?
>