Bug 40671 - IncludeController : UserDefinedVariables from Included Test plan not available in Includer Test plan
Summary: IncludeController : UserDefinedVariables from Included Test plan not availabl...
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.2
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2006-10-03 18:18 UTC by nrhope
Modified: 2012-03-22 08:18 UTC (History)
1 user (show)

fixes the problem by "including" testplan's children/variables (2.94 KB, patch)
2006-10-03 18:20 UTC, nrhope
Details | Diff
Test Plan showing it works when using Test Fragment (1.94 KB, application/octet-stream)
2012-03-22 08:16 UTC, Philippe Mouawad

Note You need to log in before you can comment on or make changes to this bug.
Description nrhope 2006-10-03 18:18:11 UTC
This patch fixes a problem I had using the IncludeController in version 2.2,
where nothing other then User Defined Variable assignments were being imported
from the included .jmx file.

Because everything needs to be placed under a TestPlan in the IncludeController,
before JMeter run, it traverses the subtree of the IncludeController; it only
adds nodes which are instanceOf Sampler or Controller. Because TestPlan is not
in these categories, JMeter just omits it and its children and that is why the
IncludeController does not work.

The solution is to only return the subtree under the TestPlan when JMeter asks
for the replacement subtree. However, it means that all user defined variables
defined in the TestPlan will be lost, so we need to make a copy for all the user
defined variables from the TestPlan. Because the user defined variable
controller works anywhere in the tree, so it just needs to copy them to
somewhere in the tree (I choose to copy them as a child under the TestPlan).

There is one problem though, the nested IncludeController will not work. I tried
to fix it but it seemed to be quite a big task. As the most important part is
working so I don’t want to spend too much time on it unless someone proves to me
that it is worthwhile fixing.
Comment 1 nrhope 2006-10-03 18:20:07 UTC
Created attachment 18957 [details]
fixes the problem by "including" testplan's children/variables
Comment 2 Ryan 2007-05-30 20:35:31 UTC
Embedded IncludeControllers is definitely a useful feature - especially with
large-scale tests.  For instance, I have several independent tests that include
common components (Login, Logoff, etc).  I also am trying to create a more
comprehensive test that runs all of the independent tests together by including
them.  Due to the bug mentioned above, the component controllers do not get
called and the scripts fail due to not being logged in and missing other common

Comment 3 Philippe Mouawad 2011-11-14 12:13:07 UTC
Still in 2.5.1
Comment 4 Philippe Mouawad 2012-03-22 08:16:29 UTC
Created attachment 28496 [details]
Test Plan showing it works when using Test Fragment
Comment 5 Philippe Mouawad 2012-03-22 08:18:05 UTC
Since JMeter 2.5, Test Fragment has been introduced and is the recommanded (and supported) way of using IncludeController.

Using this solution, User Defined Variable assignments are being imported as the attached test plan shows it.

I close issue as WONTFIX.