Bug 62847 - If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController
Summary: If Controller cannot use variable for index exposed by LoopController/WhileCo...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 4.0
Hardware: All All
: P2 normal (vote)
Target Milestone: JMETER_5.1
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2018-10-23 12:29 UTC by Glen Di Persio
Modified: 2018-11-03 22:19 UTC (History)
2 users (show)



Attachments
Tiny test (4.77 KB, application/xml)
2018-10-23 12:31 UTC, Glen Di Persio
Details

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 4 The ASF infrastructure team 2022-09-24 20:38:15 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4900