Hi Tibo,

I've got two thread groups, one that does stuff and another holding If Controllers that my Module Controller will "call". I've defined a variable in my test plan, called it "a" and given it a value of 1. The If Controllers in the disabled thread group simply test a. One test Will "Debug Sample" "a > 0 (mod)" if a is indeed greater than 0. I've another one that shouldn't Debug Sample anything as the condition is a > 1.
I use a Module Controller to "call" the two If Controllers.
Then I explicitly do the same If conditions with Debug Sample's that are missing the "(mod)" from their output.
I'm expecting my View Results Tree to contain (with 2 threads):

Begin
a > 0 (mod)
a > 0
Begin
a > 0 (mod)
a > 0

But I actually get
Begin
a > 0 (mod)
a > 1 (mod)
a > 0
Begin
a > 0 (mod)
a > 1 (mod)
a > 0

Here's the test (sorry of it's bad form to post scripts on this list, (I hope) I've kept it plain text)

Yours,
Craig

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="a" elementType="Argument">
<stringProp name="Argument.name">a</stringProp>
<stringProp name="Argument.value">1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true"> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">2</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1262966048000</longProp>
<longProp name="ThreadGroup.end_time">1262966048000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Begin" enabled="true">
<boolProp name="displayJMeterProperties">true</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">true</boolProp>
</DebugSampler>
<hashTree/>
<ModuleController guiclass="ModuleControllerGui" testclass="ModuleController" testname="a &gt; 0 (call)" enabled="true">
<collectionProp name="ModuleController.node_path">
<stringProp name="-1227702913">WorkBench</stringProp>
<stringProp name="764597751">Test Plan</stringProp>
<stringProp name="-69448498">Module Cache</stringProp>
<stringProp name="-54824258">a &gt; 0 (mod)</stringProp>
</collectionProp>
</ModuleController>
<hashTree/>
<ModuleController guiclass="ModuleControllerGui" testclass="ModuleController" testname="a &gt; 1 (call)" enabled="true">
<collectionProp name="ModuleController.node_path">
<stringProp name="-1227702913">WorkBench</stringProp>
<stringProp name="764597751">Test Plan</stringProp>
<stringProp name="-69448498">Module Cache</stringProp>
<stringProp name="832679423">a &gt; 1 (mod)</stringProp>
</collectionProp>
</ModuleController>
<hashTree/>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="a &gt; 0" enabled="true">
<stringProp name="IfController.condition">${a} &gt; 0</stringProp>
<boolProp name="IfController.evaluateAll">true</boolProp>
</IfController>
<hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="a &gt; 0" enabled="true">
<boolProp name="displayJMeterProperties">true</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">true</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="a &gt; 1" enabled="true">
<stringProp name="IfController.condition">${a} &gt; 1</stringProp>
<boolProp name="IfController.evaluateAll">true</boolProp>
</IfController>
<hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="a &gt; 1" enabled="true">
<boolProp name="displayJMeterProperties">true</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">true</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Module Cache" enabled="false"> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1263227199000</longProp>
<longProp name="ThreadGroup.end_time">1263227199000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="a &gt; 0 (mod)" enabled="true">
<stringProp name="IfController.condition">${a} &gt; 0</stringProp>
<boolProp name="IfController.evaluateAll">true</boolProp>
</IfController>
<hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="a &gt; 0 (mod)" enabled="true">
<boolProp name="displayJMeterProperties">true</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">true</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="a &gt; 1 (mod)" enabled="true">
<stringProp name="IfController.condition">${a} &gt; 1</stringProp>
<boolProp name="IfController.evaluateAll">true</boolProp>
</IfController>
<hashTree>
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="a &gt; 1 (mod)" enabled="true">
<boolProp name="displayJMeterProperties">true</boolProp>
<boolProp name="displayJMeterVariables">true</boolProp>
<boolProp name="displaySystemProperties">true</boolProp>
</DebugSampler>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>


On 12/01/2010 09:28, Thibaut Raballand wrote:
Hi,

I think you should check the variables values included in the if condition,
if any. Use the debug sampler for example.
I got a scenario here that proves me it works.

Regards,
Tibo

On Mon, Jan 11, 2010 at 17:48, Craig Emery<[email protected]>  wrote:

Module controllers and If Controllers?

I'm getting the result that if I put an If Controller in a Module
Controller and then /call/ it from a Thread Group, it's always true. :-(
Any thoughts?

TIA
Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to