Bug 43379

Summary: new controller working like switchcontroller but running subelement with name defined in switch value
Product: JMeter - Now in Github Reporter: Christoph <christoph.schragen>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 2.3   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: casecontroller

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-
controllers).

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 
ifcontrollers.

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

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
Comment 3 The ASF infrastructure team 2022-09-24 20:37:40 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2008