Bug 43379 - new controller working like switchcontroller but running subelement with name defined in switch value
Summary: new controller working like switchcontroller but running subelement with name...
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.3
Hardware: Other other
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2007-09-13 04:36 UTC by Christoph
Modified: 2007-12-05 14:37 UTC (History)
0 users

casecontroller (6.89 KB, patch)
2007-09-13 04:37 UTC, Christoph
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph 2007-09-13 04:36:44 UTC
hi, we developed several addons for jmeter, which i just integrated in jmeter 
2.3. we thought about providing them to the jmeter community, so here follows 
our addons/patches.

the first addon is a new controller, working similar to the switch controller - 
we call it "case controller" (which is helpful for avoiding use of several if-

The Case Controller allows you run a subelement defined by a value. If this 
Controller has a child that matches the name (defined as „case value“), this 
subelement will be run. If there is no match, JMeter runs the element with the 
name „Default“ (not case-sensitive). If no default element exists, JMeter skips 
the Case Controller. 

e.g.: Variable ${test} exists with value "de"

+ CaseController with CaseValue=${test}
    + SimpleController called "de"
       + Request1
       + Request2 
    + SimpleController called "fr"
       + Request3
       + Request4

as the value of ${test} is "de", the casecontroller runs the simplecontroller 
with the name "de". without casecontroller, we would have to use two 

Comment 1 Christoph 2007-09-13 04:37:20 UTC
Created attachment 20811 [details]

Patch for CaseController implementation
Comment 2 Sebb 2007-12-05 14:37:31 UTC
Thanks for the patch - a neat idea.

However, rather than create a new test element, I've extended the existing 
Switch Controller.

If the entry is not numeric, then it chooses the named child, as per the patch.

Code is in SVN r601554