Bug 62847

Summary: If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController
Product: JMeter Reporter: Glen Di Persio <glen_lewis>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: glen_lewis, p.mouawad
Priority: P2 Keywords: FixedInTrunk
Version: 4.0   
Target Milestone: JMETER_5.1   
Hardware: All   
OS: All   
Attachments: Tiny test

Description Glen Di Persio 2018-10-23 12:29:13 UTC
An If Controller inside a Loop Controller does not see the loop variable - if it is the first child (of the loop).  Placing any Sampler between the two solves this.

The following test should invoke the Debug Sampler once, but does not on 4.0 r1823414.

Test Plan
-Thread Group [1 thread]
--Loop Controller [8 loops]
---If Controller [if loop index = 3]
----Debug Sampler

Placing any sampler above the If Controller solves this.
Comment 1 Glen Di Persio 2018-10-23 12:31:18 UTC
Created attachment 36204 [details]
Tiny test
Comment 2 Philippe Mouawad 2018-11-03 22:08:26 UTC
Author: pmouawad
Date: Sat Nov  3 22:05:46 2018
New Revision: 1845696

URL: http://svn.apache.org/viewvc?rev=1845696&view=rev
Log:
Bug 62847 - If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController
Bugzilla Id: 62847

Added:
    jmeter/trunk/bin/testfiles/BUG_62847.csv
    jmeter/trunk/bin/testfiles/BUG_62847.jmx   (with props)
    jmeter/trunk/bin/testfiles/BUG_62847.xml   (with props)
Modified:
    jmeter/trunk/build.xml
    jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
    jmeter/trunk/xdocs/changes.xml


Author: pmouawad
Date: Sat Nov  3 22:07:44 2018
New Revision: 1845697

URL: http://svn.apache.org/viewvc?rev=1845697&view=rev
Log:
Bug 62847 - If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController
Set svn:eol
Bugzilla Id: 62847

Modified:
    jmeter/trunk/bin/testfiles/BUG_62847.csv   (props changed)
    jmeter/trunk/bin/testfiles/BUG_62847.xml   (props changed)
Comment 3 Philippe Mouawad 2018-11-03 22:19:04 UTC
(In reply to Glen Lewis from comment #1)
> Created attachment 36204 [details]
> Tiny test

Thanks for reporting and reproducer.

This issue should be fixed in next nightly build you can download here:

- https://ci.apache.org/projects/jmeter/nightlies/

Please test and confirm issue is fixed.

Regards