You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Shaba K <sh...@gmail.com> on 2011/11/29 17:31:06 UTC

For Each Controller

Hi All,

I have a problem with teh for each controller looping in.

there is a webpage,which has images generated

the html snippet looks like

<input id="select_175213" type="checkbox" disabled="disabled" value="175213"
 name="eventInTopPackage[175213]">
<input type="hidden" value="175213" name="eventInTopPackage[175213]">
<img id="packageInfoImage_175213" width="70" height="39" src="
/static/images/default-205x115-ticket.png" title="Test sub event static plan
" alt="Test sub event static plan

now i have to get the id's that are associated  & then after retrieving all
id's from all the images generated i have to send these parameters as post
http data.

Can some one please suggest how to go about.

my Test script looks like.

Test Plan.
+Config Elements (CSV,UDV)
+Thread Group
++http smapler
++httpsampler
++for each controller   - > i don't want the for each to post each id. (If
i read the file from a CSV file.)
+++httpsampler


Your input helps.

-Shaba

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
On 12/02/2011 05:19 PM, Shaba K wrote:
> eventInTopPackage[${event_id}] = ${event_id}

Then I suggest

sampler.addArgument(
  "eventInTopPackage["+vars.get("GET_EVENT_ID_" + i)+"]",
  vars.get("GET_EVENT_ID_" + i) );

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
int count = Integer.parseInt(vars.get("GET_EVENT_ID_matchNr"));
for(int i=1;i<=count;i++)
 { //regex counts are 1 based
         sampler.addArgument("event_id", vars.get("GET_EVENT_ID_" + i));
}


my http  post should be like this ...

eventInTopPackage[${event_id}] = ${event_id}
and other parameters ...

On Fri, Dec 2, 2011 at 4:10 PM, Felix Frank <ff...@mpexnet.de> wrote:

> On 12/02/2011 04:31 PM, Shaba K wrote:
> > But Parameters to be sent with request is formed like this
> >
> > eventInTopPackage[${sub_pack_event_id_1}] = ${sub_pack_event_id_1}
>
> How is this problematic?
>
> What exactly does your BeanShellPreProcessor look like now?
>
> Cheers,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
On 12/02/2011 04:31 PM, Shaba K wrote:
> But Parameters to be sent with request is formed like this
> 
> eventInTopPackage[${sub_pack_event_id_1}] = ${sub_pack_event_id_1}

How is this problematic?

What exactly does your BeanShellPreProcessor look like now?

Cheers,
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Unfortunatley it doesn't solve my problem.

sampler.addArgument does append the arguments for post

But Parameters to be sent with request is formed like this

eventInTopPackage[${sub_pack_event_id_1}] = ${sub_pack_event_id_1}






On Fri, Dec 2, 2011 at 8:28 AM, Felix Frank <ff...@mpexnet.de> wrote:

> On 12/01/2011 03:03 PM, Bruce Ide wrote:
> > Sounds like you need the technique described at
> >
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
>
> I like how so many Test Plan design questions end up being answered by
> Deepak one way or another :-)
>
> So thanks to Deepak for putting up the info and to Bruce for providing
> the link - the described technique saved me a big headache just yesterday.
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: For Each Controller

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
>But the actual issue is with the Beanshell Script
what leads you to this conclusion?

one way the Beanshell can cause it is if it goes to an infinite(or a really
large value) loop for which countPackage must be a really big number.
 How many threads are you running with and what listeners? If you have
enabled things like view results tree you will get memory issues

regards
deepak



On Mon, Dec 5, 2011 at 9:31 AM, Shaba K <sh...@gmail.com> wrote:

> from logs apart from the one i've mentioned earlier
>
> i also see
>
> 2011/12/05 16:47:53 ERROR - jmeter.JMeter: Uncaught exception:
> java.lang.OutOfMemoryError: GC overhead limit exceeded
>     at
> java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:64)
>    at java.lang.StringBuilder.<init>(StringBuilder.java:85)
>    at
>
> sun.swing.MenuItemLayoutHelper.getAfterCheckIconGap(MenuItemLayoutHelper.java:224)
>    at sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:137)
>    at sun.swing.MenuItemLayoutHelper.<init>(MenuItemLayoutHelper.java:107)
>    at
>
> javax.swing.plaf.basic.BasicMenuItemUI.paintMenuItem(BasicMenuItemUI.java:494)
>    at
> javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:475)
>    at
> javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:471)
>    at javax.swing.JComponent.paintComponent(JComponent.java:778)
>    at javax.swing.JComponent.paint(JComponent.java:1054)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5228)
>    at
>
> javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482)
>    at
> javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413)
>    at javax.swing.RepaintManager.paint(RepaintManager.java:1206)
>    at javax.swing.JComponent.paint(JComponent.java:1040)
>    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
>    at
> sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
>    at
> sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
>    at java.awt.Container.paint(Container.java:1967)
>    at java.awt.Window.paint(Window.java:3867)
>    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:781)
>    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728)
>    at
> javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
>    at javax.swing.RepaintManager.access$700(RepaintManager.java:59)
>    at
> javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1621)
>    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
>
> 2011/12/05 16:48:03 ERROR - jmeter.JMeter: Uncaught exception:
> java.lang.OutOfMemoryError: GC overhead limit exceeded
>     at sun.java2d.pipe.Region.getIntersectionXYXY(Region.java:481)
>    at sun.java2d.pipe.Region.getIntersectionXYWH(Region.java:469)
>    at sun.java2d.pipe.Region.getIntersection(Region.java:460)
>    at sun.java2d.SunGraphics2D.validateCompClip(SunGraphics2D.java:1826)
>    at sun.java2d.SunGraphics2D.clip(SunGraphics2D.java:1970)
>    at sun.java2d.SunGraphics2D.clipRect(SunGraphics2D.java:1940)
>    at java.awt.Graphics.create(Graphics.java:167)
>    at javax.swing.JComponent.paintChildren(JComponent.java:869)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JViewport.paint(JViewport.java:725)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JComponent.paintChildren(JComponent.java:887)
>    at javax.swing.JComponent.paint(JComponent.java:1063)
>    at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
>
> Any advise from expert's is helpful.
>
> Have increased heap size in Jmeter.bat file to 1G. But the actual issue is
> with the Beanshell Script.
>
> On Mon, Dec 5, 2011 at 5:02 PM, Shaba K <sh...@gmail.com> wrote:
>
> > Am back again with issue of
> >
> > having to map between parent & child  events & sending them as http
> > request post data
> >
> >
> > here's how my bean shell looks
> >
> > int countSubpackage =
> > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
> > for(int i=1;i<=countPackage;i++)
> > {
> >     for(int j=1;j<=3;i++)
> >
> >     { //regex counts are 1 based
> >        sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
> > i)+"]"+"["+vars.get("Get_Subpackage_id_"
> > +j)+"]",vars.get("Get_Subpackage_id_"+j) );
> >     }
> > }
> >
> > now Count of Subpackage is 3
> > Count of package is 10
> >
> > Each package has 3 subpackages.
> >
> > http post looks like package[event_id][subpackage_id] = package id.
> >
> > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
> > Method Invocation sampler.addArgument
> > 2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor:
> > Problem in BeanShell script org.apache.jorphan.util.JMeterException:
> Error
> > invoking bsh method: eval    Sourced file: inline evaluation of: ``int
> > countSubpackage =
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > i . . . '' : Method Invocation sampler.addArgument
> > 2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> > java.lang.OutOfMemoryError: GC overhead limit exceeded
> >     at
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
> >     at
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
> >     at
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
> >     at
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
> >     at
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
> >     at
> >
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
> >     at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
> >     at java.lang.Thread.run(Thread.java:722)
> >
> >
> > Any guidance please ...
> >
> >
> >
> > On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:
> >
> >> Thanks much !!!
> >>
> >>
> >>
> >> On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com>
> wrote:
> >>
> >>> ah dont make me blush - but thanks.
> >>> While we are at it , lets also thank sebb , his name always showed up
> in
> >>> the answers when I knew nothing about jmeter and had to rely on Google
> -
> >>> and sebb.
> >>>
> >>>
> >>> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
> >>>
> >>> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
> >>> > > Sounds like you need the technique described at
> >>> > >
> >>> >
> >>>
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
> >>> >
> >>> > I like how so many Test Plan design questions end up being answered
> by
> >>> > Deepak one way or another :-)
> >>> >
> >>> > So thanks to Deepak for putting up the info and to Bruce for
> providing
> >>> > the link - the described technique saved me a big headache just
> >>> yesterday.
> >>> >
> >>> > Cheers
> >>> >
> >>> > ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >>> > For additional commands, e-mail: user-help@jmeter.apache.org
> >>> >
> >>> >
> >>>
> >>
> >>
> >
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
from logs apart from the one i've mentioned earlier

i also see

2011/12/05 16:47:53 ERROR - jmeter.JMeter: Uncaught exception:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:64)
    at java.lang.StringBuilder.<init>(StringBuilder.java:85)
    at
sun.swing.MenuItemLayoutHelper.getAfterCheckIconGap(MenuItemLayoutHelper.java:224)
    at sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:137)
    at sun.swing.MenuItemLayoutHelper.<init>(MenuItemLayoutHelper.java:107)
    at
javax.swing.plaf.basic.BasicMenuItemUI.paintMenuItem(BasicMenuItemUI.java:494)
    at
javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:475)
    at
javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:471)
    at javax.swing.JComponent.paintComponent(JComponent.java:778)
    at javax.swing.JComponent.paint(JComponent.java:1054)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5228)
    at
javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482)
    at
javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1206)
    at javax.swing.JComponent.paint(JComponent.java:1040)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
    at
sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
    at
sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
    at java.awt.Container.paint(Container.java:1967)
    at java.awt.Window.paint(Window.java:3867)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:781)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728)
    at
javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
    at javax.swing.RepaintManager.access$700(RepaintManager.java:59)
    at
javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1621)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)

2011/12/05 16:48:03 ERROR - jmeter.JMeter: Uncaught exception:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at sun.java2d.pipe.Region.getIntersectionXYXY(Region.java:481)
    at sun.java2d.pipe.Region.getIntersectionXYWH(Region.java:469)
    at sun.java2d.pipe.Region.getIntersection(Region.java:460)
    at sun.java2d.SunGraphics2D.validateCompClip(SunGraphics2D.java:1826)
    at sun.java2d.SunGraphics2D.clip(SunGraphics2D.java:1970)
    at sun.java2d.SunGraphics2D.clipRect(SunGraphics2D.java:1940)
    at java.awt.Graphics.create(Graphics.java:167)
    at javax.swing.JComponent.paintChildren(JComponent.java:869)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JViewport.paint(JViewport.java:725)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JComponent.paintChildren(JComponent.java:887)
    at javax.swing.JComponent.paint(JComponent.java:1063)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)

Any advise from expert's is helpful.

Have increased heap size in Jmeter.bat file to 1G. But the actual issue is
with the Beanshell Script.

On Mon, Dec 5, 2011 at 5:02 PM, Shaba K <sh...@gmail.com> wrote:

> Am back again with issue of
>
> having to map between parent & child  events & sending them as http
> request post data
>
>
> here's how my bean shell looks
>
> int countSubpackage =
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
> for(int i=1;i<=countPackage;i++)
> {
>     for(int j=1;j<=3;i++)
>
>     { //regex counts are 1 based
>        sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
> i)+"]"+"["+vars.get("Get_Subpackage_id_"
> +j)+"]",vars.get("Get_Subpackage_id_"+j) );
>     }
> }
>
> now Count of Subpackage is 3
> Count of package is 10
>
> Each package has 3 subpackages.
>
> http post looks like package[event_id][subpackage_id] = package id.
>
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
> Method Invocation sampler.addArgument
> 2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor:
> Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error
> invoking bsh method: eval    Sourced file: inline evaluation of: ``int
> countSubpackage = Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> i . . . '' : Method Invocation sampler.addArgument
> 2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> java.lang.OutOfMemoryError: GC overhead limit exceeded
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
>     at
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
>     at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
>     at java.lang.Thread.run(Thread.java:722)
>
>
> Any guidance please ...
>
>
>
> On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:
>
>> Thanks much !!!
>>
>>
>>
>> On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com> wrote:
>>
>>> ah dont make me blush - but thanks.
>>> While we are at it , lets also thank sebb , his name always showed up in
>>> the answers when I knew nothing about jmeter and had to rely on Google -
>>> and sebb.
>>>
>>>
>>> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
>>>
>>> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
>>> > > Sounds like you need the technique described at
>>> > >
>>> >
>>> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
>>> >
>>> > I like how so many Test Plan design questions end up being answered by
>>> > Deepak one way or another :-)
>>> >
>>> > So thanks to Deepak for putting up the info and to Bruce for providing
>>> > the link - the described technique saved me a big headache just
>>> yesterday.
>>> >
>>> > Cheers
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> > For additional commands, e-mail: user-help@jmeter.apache.org
>>> >
>>> >
>>>
>>
>>
>

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
Dude, seriously - by writing your desired results in the below notation,
you're fuckiny *my* brain and I refuse to even try and guess what you
need to do.

Please clean up your expected results and post again.

Also please perform the recommended refactoring and post your cleaned up
BeanShell code.

On 12/06/2011 01:07 PM, Shaba K wrote:
> 1,1 =1,1,2=2,1,3=3
> 2,4=4,2,5=5,2,6=6
> 3,7=7,3,8=8,3,9=9
> so on ...

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
upperbound  is 30.

as each pack_id which is parent has 3 subpackages only

that's why added j<=3

all i want is

1,1 =1,1,2=2,1,3=3
2,4=4,2,5=5,2,6=6
3,7=7,3,8=8,3,9=9
so on ...

Am not getting it right ..my brain is just going bleak ....

On Tue, Dec 6, 2011 at 11:58 AM, Felix Frank <ff...@mpexnet.de> wrote:

> Hi,
>
> On 12/06/2011 11:16 AM, Shaba K wrote:
> >
> > all i want is
>
> OK, then this
>
> > for(int j=i;j<=3;j++)
>
> is wrong. Why j<=3. It doesn't make any sense. What's your upper bound
> for the subpackage ID?
>
> You should refactor the whole thing.
>
> 1. replace i and j by meaningful iterator names like pkg_id and sub_pkg_id
> 2. get your String concatenation out of the addArgument call
>
> Insert lines like
> String index1 = "[" + vars.get(...) + "]";
> String index2 = "[" + vars.get(...) + "]";
> String param  = "package" + index1 + index2;
> String value = ...;
> then
> addArgument(param, value);
>
> If possible, add debug output in some form (although I haven't managed
> to figure out a good way to do this yet).
>
> HTH,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

On 12/06/2011 11:16 AM, Shaba K wrote:
> 
> all i want is

OK, then this

> for(int j=i;j<=3;j++)

is wrong. Why j<=3. It doesn't make any sense. What's your upper bound
for the subpackage ID?

You should refactor the whole thing.

1. replace i and j by meaningful iterator names like pkg_id and sub_pkg_id
2. get your String concatenation out of the addArgument call

Insert lines like
String index1 = "[" + vars.get(...) + "]";
String index2 = "[" + vars.get(...) + "]";
String param  = "package" + index1 + index2;
String value = ...;
then
addArgument(param, value);

If possible, add debug output in some form (although I haven't managed
to figure out a good way to do this yet).

HTH,
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Am not getting it soem how right ...

I have my Get_Subpackage_id_matchNr=30 , Get_event_Id_matchNr=10

int countSubpackage =
Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
for(int i=1;i<=countPackage;i++)
{
    for(int j=i;j<=3;j++)
    {
       sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
i)+"]"+"["+vars.get("Get_Subpackage_id_"
+j)+"]",vars.get("Get_Subpackage_id_"+j) );
    }
}

all i want is

1,1 =1,1,2=2,1,3=3
2,4=4,2,5=5,2,6=6
3,7=7,3,8=8,3,9=9
so on ...

Am not getting it right ..my brain is just going bleak ....



On Tue, Dec 6, 2011 at 8:20 AM, Felix Frank <ff...@mpexnet.de> wrote:

> Hi,
>
> On 12/05/2011 06:02 PM, Shaba K wrote:
> > here's how my bean shell looks
>
> for what it's worth, I've found debugging BeanShell inside Jmeter to be
> rather excrutiating.
> Here is the general workflow I adopted:
>
> - watch the jmeter.log for BeanShell related errors
> - comment out almost everything from the PreProcessor
> - confirm that no errors are logged
> - uncomment the BeanShell code peacemeal until errors return
>
> Granted, eyeing my code sharply would have done it for me as well, but
> it was a helpful starting point.
>
> Cheers,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

On 12/05/2011 06:02 PM, Shaba K wrote:
> here's how my bean shell looks

for what it's worth, I've found debugging BeanShell inside Jmeter to be
rather excrutiating.
Here is the general workflow I adopted:

- watch the jmeter.log for BeanShell related errors
- comment out almost everything from the PreProcessor
- confirm that no errors are logged
- uncomment the BeanShell code peacemeal until errors return

Granted, eyeing my code sharply would have done it for me as well, but
it was a helpful starting point.

Cheers,
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Sighhh .. i overlooked ...

Thanks .. will update you tomorrow.

Its a single thread, with view results tree listener.

-Cheers

On Mon, Dec 5, 2011 at 6:00 PM, Deepak Shetty <sh...@gmail.com> wrote:

> ah your eyesight is better than mine :)
> Yes that will cause an infinite loop.
>
> On Mon, Dec 5, 2011 at 9:55 AM, Tanakiat Srisaranayakul <
> tanakiats@gmail.com
> > wrote:
>
> > the child for loop should be for(int j=1;j<=3;j++) instead of for(int
> > j=1;j<=3;i++)
> >
> > I'm curious whether it is a typo in your beanshell or in your email. If
> > it's typo in email, this should not fix your problem. Please wait for
> other
> > responses.
> >
> > Regards,
> >
> > On Tue, Dec 6, 2011 at 12:02 AM, Shaba K <sh...@gmail.com> wrote:
> >
> > > Am back again with issue of
> > >
> > > having to map between parent & child  events & sending them as http
> > request
> > > post data
> > >
> > >
> > > here's how my bean shell looks
> > >
> > > int countSubpackage =
> > > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > > int countPackage =
> Integer.parseInt(vars.get("Get_event_Id_matchNr"));
> > > for(int i=1;i<=countPackage;i++)
> > > {
> > >    for(int j=1;j<=3;i++)
> > >    { //regex counts are 1 based
> > >       sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
> > > i)+"]"+"["+vars.get("Get_Subpackage_id_"
> > > +j)+"]",vars.get("Get_Subpackage_id_"+j) );
> > >    }
> > > }
> > >
> > > now Count of Subpackage is 3
> > > Count of package is 10
> > >
> > > Each package has 3 subpackages.
> > >
> > > http post looks like package[event_id][subpackage_id] = package id.
> > >
> > > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
> > > Method Invocation sampler.addArgument
> > > 2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor:
> > Problem
> > > in BeanShell script org.apache.jorphan.util.JMeterException: Error
> > invoking
> > > bsh method: eval    Sourced file: inline evaluation of: ``int
> > > countSubpackage =
> > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > > i . . . '' : Method Invocation sampler.addArgument
> > > 2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> > > java.lang.OutOfMemoryError: GC overhead limit exceeded
> > >    at
> > >
> > >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
> > >    at
> > >
> > >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
> > >    at
> > >
> > >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
> > >    at
> > >
> > >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
> > >    at
> > >
> > >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
> > >    at
> > >
> > >
> >
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
> > >    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
> > >    at java.lang.Thread.run(Thread.java:722)
> > >
> > >
> > > Any guidance please ...
> > >
> > >
> > > On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:
> > >
> > > > Thanks much !!!
> > > >
> > > >
> > > >
> > > > On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com>
> > wrote:
> > > >
> > > >> ah dont make me blush - but thanks.
> > > >> While we are at it , lets also thank sebb , his name always showed
> up
> > in
> > > >> the answers when I knew nothing about jmeter and had to rely on
> > Google -
> > > >> and sebb.
> > > >>
> > > >>
> > > >> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
> > > >>
> > > >> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
> > > >> > > Sounds like you need the technique described at
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
> > > >> >
> > > >> > I like how so many Test Plan design questions end up being
> answered
> > by
> > > >> > Deepak one way or another :-)
> > > >> >
> > > >> > So thanks to Deepak for putting up the info and to Bruce for
> > providing
> > > >> > the link - the described technique saved me a big headache just
> > > >> yesterday.
> > > >> >
> > > >> > Cheers
> > > >> >
> > > >> >
> > ---------------------------------------------------------------------
> > > >> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > >> > For additional commands, e-mail: user-help@jmeter.apache.org
> > > >> >
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>

Re: For Each Controller

Posted by Deepak Shetty <sh...@gmail.com>.
ah your eyesight is better than mine :)
Yes that will cause an infinite loop.

On Mon, Dec 5, 2011 at 9:55 AM, Tanakiat Srisaranayakul <tanakiats@gmail.com
> wrote:

> the child for loop should be for(int j=1;j<=3;j++) instead of for(int
> j=1;j<=3;i++)
>
> I'm curious whether it is a typo in your beanshell or in your email. If
> it's typo in email, this should not fix your problem. Please wait for other
> responses.
>
> Regards,
>
> On Tue, Dec 6, 2011 at 12:02 AM, Shaba K <sh...@gmail.com> wrote:
>
> > Am back again with issue of
> >
> > having to map between parent & child  events & sending them as http
> request
> > post data
> >
> >
> > here's how my bean shell looks
> >
> > int countSubpackage =
> > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
> > for(int i=1;i<=countPackage;i++)
> > {
> >    for(int j=1;j<=3;i++)
> >    { //regex counts are 1 based
> >       sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
> > i)+"]"+"["+vars.get("Get_Subpackage_id_"
> > +j)+"]",vars.get("Get_Subpackage_id_"+j) );
> >    }
> > }
> >
> > now Count of Subpackage is 3
> > Count of package is 10
> >
> > Each package has 3 subpackages.
> >
> > http post looks like package[event_id][subpackage_id] = package id.
> >
> > Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
> > Method Invocation sampler.addArgument
> > 2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor:
> Problem
> > in BeanShell script org.apache.jorphan.util.JMeterException: Error
> invoking
> > bsh method: eval    Sourced file: inline evaluation of: ``int
> > countSubpackage =
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> > i . . . '' : Method Invocation sampler.addArgument
> > 2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> > java.lang.OutOfMemoryError: GC overhead limit exceeded
> >    at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
> >    at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
> >    at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
> >    at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
> >    at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
> >    at
> >
> >
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
> >    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
> >    at java.lang.Thread.run(Thread.java:722)
> >
> >
> > Any guidance please ...
> >
> >
> > On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:
> >
> > > Thanks much !!!
> > >
> > >
> > >
> > > On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com>
> wrote:
> > >
> > >> ah dont make me blush - but thanks.
> > >> While we are at it , lets also thank sebb , his name always showed up
> in
> > >> the answers when I knew nothing about jmeter and had to rely on
> Google -
> > >> and sebb.
> > >>
> > >>
> > >> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
> > >>
> > >> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
> > >> > > Sounds like you need the technique described at
> > >> > >
> > >> >
> > >>
> >
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
> > >> >
> > >> > I like how so many Test Plan design questions end up being answered
> by
> > >> > Deepak one way or another :-)
> > >> >
> > >> > So thanks to Deepak for putting up the info and to Bruce for
> providing
> > >> > the link - the described technique saved me a big headache just
> > >> yesterday.
> > >> >
> > >> > Cheers
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > >> > For additional commands, e-mail: user-help@jmeter.apache.org
> > >> >
> > >> >
> > >>
> > >
> > >
> >
>

Re: For Each Controller

Posted by Tanakiat Srisaranayakul <ta...@gmail.com>.
the child for loop should be for(int j=1;j<=3;j++) instead of for(int
j=1;j<=3;i++)

I'm curious whether it is a typo in your beanshell or in your email. If
it's typo in email, this should not fix your problem. Please wait for other
responses.

Regards,

On Tue, Dec 6, 2011 at 12:02 AM, Shaba K <sh...@gmail.com> wrote:

> Am back again with issue of
>
> having to map between parent & child  events & sending them as http request
> post data
>
>
> here's how my bean shell looks
>
> int countSubpackage =
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
> for(int i=1;i<=countPackage;i++)
> {
>    for(int j=1;j<=3;i++)
>    { //regex counts are 1 based
>       sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
> i)+"]"+"["+vars.get("Get_Subpackage_id_"
> +j)+"]",vars.get("Get_Subpackage_id_"+j) );
>    }
> }
>
> now Count of Subpackage is 3
> Count of package is 10
>
> Each package has 3 subpackages.
>
> http post looks like package[event_id][subpackage_id] = package id.
>
> Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
> Method Invocation sampler.addArgument
> 2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem
> in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
> bsh method: eval    Sourced file: inline evaluation of: ``int
> countSubpackage = Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
> i . . . '' : Method Invocation sampler.addArgument
> 2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> java.lang.OutOfMemoryError: GC overhead limit exceeded
>    at
>
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
>    at
>
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
>    at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
>    at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
>    at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
>    at
>
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
>    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
>    at java.lang.Thread.run(Thread.java:722)
>
>
> Any guidance please ...
>
>
> On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:
>
> > Thanks much !!!
> >
> >
> >
> > On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com> wrote:
> >
> >> ah dont make me blush - but thanks.
> >> While we are at it , lets also thank sebb , his name always showed up in
> >> the answers when I knew nothing about jmeter and had to rely on Google -
> >> and sebb.
> >>
> >>
> >> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
> >>
> >> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
> >> > > Sounds like you need the technique described at
> >> > >
> >> >
> >>
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
> >> >
> >> > I like how so many Test Plan design questions end up being answered by
> >> > Deepak one way or another :-)
> >> >
> >> > So thanks to Deepak for putting up the info and to Bruce for providing
> >> > the link - the described technique saved me a big headache just
> >> yesterday.
> >> >
> >> > Cheers
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >> > For additional commands, e-mail: user-help@jmeter.apache.org
> >> >
> >> >
> >>
> >
> >
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Am back again with issue of

having to map between parent & child  events & sending them as http request
post data


here's how my bean shell looks

int countSubpackage =
Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
int countPackage =   Integer.parseInt(vars.get("Get_event_Id_matchNr"));
for(int i=1;i<=countPackage;i++)
{
    for(int j=1;j<=3;i++)
    { //regex counts are 1 based
       sampler.addArgument( "package["+ vars.get("Get_event_Id_" +
i)+"]"+"["+vars.get("Get_Subpackage_id_"
+j)+"]",vars.get("Get_Subpackage_id_"+j) );
    }
}

now Count of Subpackage is 3
Count of package is 10

Each package has 3 subpackages.

http post looks like package[event_id][subpackage_id] = package id.

Integer.parseInt(vars.get("Get_Subpackage_id_matchNr")); i . . . '' :
Method Invocation sampler.addArgument
2011/12/05 16:47:30 WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem
in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
bsh method: eval    Sourced file: inline evaluation of: ``int
countSubpackage = Integer.parseInt(vars.get("Get_Subpackage_id_matchNr"));
i . . . '' : Method Invocation sampler.addArgument
2011/12/05 16:47:36 ERROR - jmeter.threads.JMeterThread: Test failed!
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPostData(HTTPHC4Impl.java:942)
    at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:261)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
    at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
    at java.lang.Thread.run(Thread.java:722)


Any guidance please ...


On Sun, Dec 4, 2011 at 6:35 PM, Shaba K <sh...@gmail.com> wrote:

> Thanks much !!!
>
>
>
> On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com> wrote:
>
>> ah dont make me blush - but thanks.
>> While we are at it , lets also thank sebb , his name always showed up in
>> the answers when I knew nothing about jmeter and had to rely on Google -
>> and sebb.
>>
>>
>> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
>>
>> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
>> > > Sounds like you need the technique described at
>> > >
>> >
>> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
>> >
>> > I like how so many Test Plan design questions end up being answered by
>> > Deepak one way or another :-)
>> >
>> > So thanks to Deepak for putting up the info and to Bruce for providing
>> > the link - the described technique saved me a big headache just
>> yesterday.
>> >
>> > Cheers
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> > For additional commands, e-mail: user-help@jmeter.apache.org
>> >
>> >
>>
>
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Thanks much !!!



On Fri, Dec 2, 2011 at 6:03 PM, Deepak Shetty <sh...@gmail.com> wrote:

> ah dont make me blush - but thanks.
> While we are at it , lets also thank sebb , his name always showed up in
> the answers when I knew nothing about jmeter and had to rely on Google -
> and sebb.
>
>
> On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:
>
> > On 12/01/2011 03:03 PM, Bruce Ide wrote:
> > > Sounds like you need the technique described at
> > >
> >
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
> >
> > I like how so many Test Plan design questions end up being answered by
> > Deepak one way or another :-)
> >
> > So thanks to Deepak for putting up the info and to Bruce for providing
> > the link - the described technique saved me a big headache just
> yesterday.
> >
> > Cheers
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
> >
>

Re: For Each Controller

Posted by Deepak Shetty <sh...@gmail.com>.
ah dont make me blush - but thanks.
While we are at it , lets also thank sebb , his name always showed up in
the answers when I knew nothing about jmeter and had to rely on Google -
and sebb.


On Fri, Dec 2, 2011 at 12:28 AM, Felix Frank <ff...@mpexnet.de> wrote:

> On 12/01/2011 03:03 PM, Bruce Ide wrote:
> > Sounds like you need the technique described at
> >
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html
>
> I like how so many Test Plan design questions end up being answered by
> Deepak one way or another :-)
>
> So thanks to Deepak for putting up the info and to Bruce for providing
> the link - the described technique saved me a big headache just yesterday.
>
> Cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: For Each Controller

Posted by Felix Frank <ff...@mpexnet.de>.
On 12/01/2011 03:03 PM, Bruce Ide wrote:
> Sounds like you need the technique described at
> http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html

I like how so many Test Plan design questions end up being answered by
Deepak one way or another :-)

So thanks to Deepak for putting up the info and to Bruce for providing
the link - the described technique saved me a big headache just yesterday.

Cheers

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Bruce Ide <fl...@gmail.com>.
Sounds like you need the technique described at
http://theworkaholic.blogspot.com/2010/03/dynamic-parameters-in-jmeter.html

-- 
Bruce Ide
FlyingRhenquest@gmail.com

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Am passing in while controller now with
__evalVar(${subpackage},${childevents})

it is looping infinitely.

-Cheers

On Thu, Dec 1, 2011 at 10:23 AM, Shaba K <sh...@gmail.com> wrote:

> Nermin,
>
> If i use a loop & the child to that would be a HTTP request.
>
> Will it not post each loop.
>
> -Cheers
>
>
> On Thu, Dec 1, 2011 at 10:21 AM, Shaba K <sh...@gmail.com> wrote:
>
>> Not sure if i have understood you.
>>
>> These values been fetched are dynamic.
>>
>> If we concatenate we need to know how many variables we are passing ..
>>
>> I may sound silly ... but am lost
>>
>> Cheers
>>
>>
>> On Wed, Nov 30, 2011 at 11:47 AM, Nermin CALUK <ne...@atlantbh.com>wrote:
>>
>>> Depending on what you need:
>>>
>>> - You use loop and ${evalVar()} when you want to loop through all matched
>>> occurrences
>>> - If you need to concatenate these values, simply use
>>> ${VAR1}${VAR2}${VAR3}
>>> (without spaces)
>>>
>>> Nermin
>>>
>>> -----Original Message-----
>>> From: Shaba K [mailto:shabazia09@gmail.com]
>>> Sent: Wednesday, November 30, 2011 10:47 AM
>>> To: JMeter Users List
>>> Subject: Re: For Each Controller
>>>
>>> Hi All,
>>>
>>> Here's how my reg ex looks
>>>
>>> GET_EVENT_ID_1=175213
>>> GET_EVENT_ID_1_g=1
>>> GET_EVENT_ID_1_g0=packageInfo_175213">
>>> GET_EVENT_ID_1_g1=175213
>>> GET_EVENT_ID_2=175225
>>> GET_EVENT_ID_2_g=1
>>> GET_EVENT_ID_2_g0=packageInfo_175225">
>>> GET_EVENT_ID_2_g1=175225
>>> GET_EVENT_ID_3=175237
>>> GET_EVENT_ID_3_g=1
>>> GET_EVENT_ID_3_g0=packageInfo_175237">
>>> GET_EVENT_ID_3_g1=175237
>>> GET_EVENT_ID_4=175249
>>> GET_EVENT_ID_4_g=1
>>> GET_EVENT_ID_4_g0=packageInfo_175249">
>>> GET_EVENT_ID_4_g1=175249
>>> GET_EVENT_ID_matchNr=4
>>>
>>>
>>> my for loop - INPUT var  - GET_EVENT_ID
>>> OUTput  var = EVENT_ID
>>>
>>> Debug sampler shows the value being fetched is correct.
>>>
>>> I have to build all that is found in the one highlighted & send as
>>> parameters for the next request ??
>>>
>>> i can't add in for loop & a request ... can some guide on this please
>>>
>>> -Shabana
>>>
>>> On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:
>>>
>>> > Hi All,
>>> >
>>> > I have a problem with teh for each controller looping in.
>>> >
>>> > there is a webpage,which has images generated
>>> >
>>> > the html snippet looks like
>>> >
>>> > <input id="select_175213" type="checkbox" disabled="disabled" value="
>>> > 175213" name="eventInTopPackage[175213]">
>>> > <input type="hidden" value="175213" name="eventInTopPackage[175213]">
>>> > <img id="packageInfoImage_175213" width="70" height="39" src="
>>> > /static/images/default-205x115-ticket.png" title="Test sub event static
>>> > plan" alt="Test sub event static plan
>>> >
>>> > now i have to get the id's that are associated  & then after retrieving
>>> > all id's from all the images generated i have to send these parameters
>>> as
>>> > post http data.
>>> >
>>> > Can some one please suggest how to go about.
>>> >
>>> > my Test script looks like.
>>> >
>>> > Test Plan.
>>> > +Config Elements (CSV,UDV)
>>> > +Thread Group
>>> > ++http smapler
>>> > ++httpsampler
>>> > ++for each controller   - > i don't want the for each to post each id.
>>> (If
>>> > i read the file from a CSV file.)
>>> > +++httpsampler
>>> >
>>> >
>>> > Your input helps.
>>> >
>>> > -Shaba
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>>
>>
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Nermin,

If i use a loop & the child to that would be a HTTP request.

Will it not post each loop.

-Cheers

On Thu, Dec 1, 2011 at 10:21 AM, Shaba K <sh...@gmail.com> wrote:

> Not sure if i have understood you.
>
> These values been fetched are dynamic.
>
> If we concatenate we need to know how many variables we are passing ..
>
> I may sound silly ... but am lost
>
> Cheers
>
>
> On Wed, Nov 30, 2011 at 11:47 AM, Nermin CALUK <ne...@atlantbh.com>wrote:
>
>> Depending on what you need:
>>
>> - You use loop and ${evalVar()} when you want to loop through all matched
>> occurrences
>> - If you need to concatenate these values, simply use
>> ${VAR1}${VAR2}${VAR3}
>> (without spaces)
>>
>> Nermin
>>
>> -----Original Message-----
>> From: Shaba K [mailto:shabazia09@gmail.com]
>> Sent: Wednesday, November 30, 2011 10:47 AM
>> To: JMeter Users List
>> Subject: Re: For Each Controller
>>
>> Hi All,
>>
>> Here's how my reg ex looks
>>
>> GET_EVENT_ID_1=175213
>> GET_EVENT_ID_1_g=1
>> GET_EVENT_ID_1_g0=packageInfo_175213">
>> GET_EVENT_ID_1_g1=175213
>> GET_EVENT_ID_2=175225
>> GET_EVENT_ID_2_g=1
>> GET_EVENT_ID_2_g0=packageInfo_175225">
>> GET_EVENT_ID_2_g1=175225
>> GET_EVENT_ID_3=175237
>> GET_EVENT_ID_3_g=1
>> GET_EVENT_ID_3_g0=packageInfo_175237">
>> GET_EVENT_ID_3_g1=175237
>> GET_EVENT_ID_4=175249
>> GET_EVENT_ID_4_g=1
>> GET_EVENT_ID_4_g0=packageInfo_175249">
>> GET_EVENT_ID_4_g1=175249
>> GET_EVENT_ID_matchNr=4
>>
>>
>> my for loop - INPUT var  - GET_EVENT_ID
>> OUTput  var = EVENT_ID
>>
>> Debug sampler shows the value being fetched is correct.
>>
>> I have to build all that is found in the one highlighted & send as
>> parameters for the next request ??
>>
>> i can't add in for loop & a request ... can some guide on this please
>>
>> -Shabana
>>
>> On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:
>>
>> > Hi All,
>> >
>> > I have a problem with teh for each controller looping in.
>> >
>> > there is a webpage,which has images generated
>> >
>> > the html snippet looks like
>> >
>> > <input id="select_175213" type="checkbox" disabled="disabled" value="
>> > 175213" name="eventInTopPackage[175213]">
>> > <input type="hidden" value="175213" name="eventInTopPackage[175213]">
>> > <img id="packageInfoImage_175213" width="70" height="39" src="
>> > /static/images/default-205x115-ticket.png" title="Test sub event static
>> > plan" alt="Test sub event static plan
>> >
>> > now i have to get the id's that are associated  & then after retrieving
>> > all id's from all the images generated i have to send these parameters
>> as
>> > post http data.
>> >
>> > Can some one please suggest how to go about.
>> >
>> > my Test script looks like.
>> >
>> > Test Plan.
>> > +Config Elements (CSV,UDV)
>> > +Thread Group
>> > ++http smapler
>> > ++httpsampler
>> > ++for each controller   - > i don't want the for each to post each id.
>> (If
>> > i read the file from a CSV file.)
>> > +++httpsampler
>> >
>> >
>> > Your input helps.
>> >
>> > -Shaba
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Not sure if i have understood you.

These values been fetched are dynamic.

If we concatenate we need to know how many variables we are passing ..

I may sound silly ... but am lost

Cheers

On Wed, Nov 30, 2011 at 11:47 AM, Nermin CALUK <ne...@atlantbh.com> wrote:

> Depending on what you need:
>
> - You use loop and ${evalVar()} when you want to loop through all matched
> occurrences
> - If you need to concatenate these values, simply use ${VAR1}${VAR2}${VAR3}
> (without spaces)
>
> Nermin
>
> -----Original Message-----
> From: Shaba K [mailto:shabazia09@gmail.com]
> Sent: Wednesday, November 30, 2011 10:47 AM
> To: JMeter Users List
> Subject: Re: For Each Controller
>
> Hi All,
>
> Here's how my reg ex looks
>
> GET_EVENT_ID_1=175213
> GET_EVENT_ID_1_g=1
> GET_EVENT_ID_1_g0=packageInfo_175213">
> GET_EVENT_ID_1_g1=175213
> GET_EVENT_ID_2=175225
> GET_EVENT_ID_2_g=1
> GET_EVENT_ID_2_g0=packageInfo_175225">
> GET_EVENT_ID_2_g1=175225
> GET_EVENT_ID_3=175237
> GET_EVENT_ID_3_g=1
> GET_EVENT_ID_3_g0=packageInfo_175237">
> GET_EVENT_ID_3_g1=175237
> GET_EVENT_ID_4=175249
> GET_EVENT_ID_4_g=1
> GET_EVENT_ID_4_g0=packageInfo_175249">
> GET_EVENT_ID_4_g1=175249
> GET_EVENT_ID_matchNr=4
>
>
> my for loop - INPUT var  - GET_EVENT_ID
> OUTput  var = EVENT_ID
>
> Debug sampler shows the value being fetched is correct.
>
> I have to build all that is found in the one highlighted & send as
> parameters for the next request ??
>
> i can't add in for loop & a request ... can some guide on this please
>
> -Shabana
>
> On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:
>
> > Hi All,
> >
> > I have a problem with teh for each controller looping in.
> >
> > there is a webpage,which has images generated
> >
> > the html snippet looks like
> >
> > <input id="select_175213" type="checkbox" disabled="disabled" value="
> > 175213" name="eventInTopPackage[175213]">
> > <input type="hidden" value="175213" name="eventInTopPackage[175213]">
> > <img id="packageInfoImage_175213" width="70" height="39" src="
> > /static/images/default-205x115-ticket.png" title="Test sub event static
> > plan" alt="Test sub event static plan
> >
> > now i have to get the id's that are associated  & then after retrieving
> > all id's from all the images generated i have to send these parameters as
> > post http data.
> >
> > Can some one please suggest how to go about.
> >
> > my Test script looks like.
> >
> > Test Plan.
> > +Config Elements (CSV,UDV)
> > +Thread Group
> > ++http smapler
> > ++httpsampler
> > ++for each controller   - > i don't want the for each to post each id.
> (If
> > i read the file from a CSV file.)
> > +++httpsampler
> >
> >
> > Your input helps.
> >
> > -Shaba
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

RE: For Each Controller

Posted by Nermin CALUK <ne...@atlantbh.com>.
Depending on what you need:

- You use loop and ${evalVar()} when you want to loop through all matched
occurrences
- If you need to concatenate these values, simply use ${VAR1}${VAR2}${VAR3}
(without spaces)

Nermin

-----Original Message-----
From: Shaba K [mailto:shabazia09@gmail.com] 
Sent: Wednesday, November 30, 2011 10:47 AM
To: JMeter Users List
Subject: Re: For Each Controller

Hi All,

Here's how my reg ex looks

GET_EVENT_ID_1=175213
GET_EVENT_ID_1_g=1
GET_EVENT_ID_1_g0=packageInfo_175213">
GET_EVENT_ID_1_g1=175213
GET_EVENT_ID_2=175225
GET_EVENT_ID_2_g=1
GET_EVENT_ID_2_g0=packageInfo_175225">
GET_EVENT_ID_2_g1=175225
GET_EVENT_ID_3=175237
GET_EVENT_ID_3_g=1
GET_EVENT_ID_3_g0=packageInfo_175237">
GET_EVENT_ID_3_g1=175237
GET_EVENT_ID_4=175249
GET_EVENT_ID_4_g=1
GET_EVENT_ID_4_g0=packageInfo_175249">
GET_EVENT_ID_4_g1=175249
GET_EVENT_ID_matchNr=4


my for loop - INPUT var  - GET_EVENT_ID
OUTput  var = EVENT_ID

Debug sampler shows the value being fetched is correct.

I have to build all that is found in the one highlighted & send as
parameters for the next request ??

i can't add in for loop & a request ... can some guide on this please

-Shabana

On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:

> Hi All,
>
> I have a problem with teh for each controller looping in.
>
> there is a webpage,which has images generated
>
> the html snippet looks like
>
> <input id="select_175213" type="checkbox" disabled="disabled" value="
> 175213" name="eventInTopPackage[175213]">
> <input type="hidden" value="175213" name="eventInTopPackage[175213]">
> <img id="packageInfoImage_175213" width="70" height="39" src="
> /static/images/default-205x115-ticket.png" title="Test sub event static
> plan" alt="Test sub event static plan
>
> now i have to get the id's that are associated  & then after retrieving
> all id's from all the images generated i have to send these parameters as
> post http data.
>
> Can some one please suggest how to go about.
>
> my Test script looks like.
>
> Test Plan.
> +Config Elements (CSV,UDV)
> +Thread Group
> ++http smapler
> ++httpsampler
> ++for each controller   - > i don't want the for each to post each id. (If
> i read the file from a CSV file.)
> +++httpsampler
>
>
> Your input helps.
>
> -Shaba
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
Hi All,

Here's how my reg ex looks

GET_EVENT_ID_1=175213
GET_EVENT_ID_1_g=1
GET_EVENT_ID_1_g0=packageInfo_175213">
GET_EVENT_ID_1_g1=175213
GET_EVENT_ID_2=175225
GET_EVENT_ID_2_g=1
GET_EVENT_ID_2_g0=packageInfo_175225">
GET_EVENT_ID_2_g1=175225
GET_EVENT_ID_3=175237
GET_EVENT_ID_3_g=1
GET_EVENT_ID_3_g0=packageInfo_175237">
GET_EVENT_ID_3_g1=175237
GET_EVENT_ID_4=175249
GET_EVENT_ID_4_g=1
GET_EVENT_ID_4_g0=packageInfo_175249">
GET_EVENT_ID_4_g1=175249
GET_EVENT_ID_matchNr=4


my for loop - INPUT var  - GET_EVENT_ID
OUTput  var = EVENT_ID

Debug sampler shows the value being fetched is correct.

I have to build all that is found in the one highlighted & send as
parameters for the next request ??

i can't add in for loop & a request ... can some guide on this please

-Shabana

On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:

> Hi All,
>
> I have a problem with teh for each controller looping in.
>
> there is a webpage,which has images generated
>
> the html snippet looks like
>
> <input id="select_175213" type="checkbox" disabled="disabled" value="
> 175213" name="eventInTopPackage[175213]">
> <input type="hidden" value="175213" name="eventInTopPackage[175213]">
> <img id="packageInfoImage_175213" width="70" height="39" src="
> /static/images/default-205x115-ticket.png" title="Test sub event static
> plan" alt="Test sub event static plan
>
> now i have to get the id's that are associated  & then after retrieving
> all id's from all the images generated i have to send these parameters as
> post http data.
>
> Can some one please suggest how to go about.
>
> my Test script looks like.
>
> Test Plan.
> +Config Elements (CSV,UDV)
> +Thread Group
> ++http smapler
> ++httpsampler
> ++for each controller   - > i don't want the for each to post each id. (If
> i read the file from a CSV file.)
> +++httpsampler
>
>
> Your input helps.
>
> -Shaba
>

Re: For Each Controller

Posted by Shaba K <sh...@gmail.com>.
So here's what i've done...

Extracted the packageInfoImage_175213 from Regular expression extractor.

Now the for loop is not working as am expecting ..

On Tue, Nov 29, 2011 at 4:31 PM, Shaba K <sh...@gmail.com> wrote:

> Hi All,
>
> I have a problem with teh for each controller looping in.
>
> there is a webpage,which has images generated
>
> the html snippet looks like
>
> <input id="select_175213" type="checkbox" disabled="disabled" value="
> 175213" name="eventInTopPackage[175213]">
> <input type="hidden" value="175213" name="eventInTopPackage[175213]">
> <img id="packageInfoImage_175213" width="70" height="39" src="
> /static/images/default-205x115-ticket.png" title="Test sub event static
> plan" alt="Test sub event static plan
>
> now i have to get the id's that are associated  & then after retrieving
> all id's from all the images generated i have to send these parameters as
> post http data.
>
> Can some one please suggest how to go about.
>
> my Test script looks like.
>
> Test Plan.
> +Config Elements (CSV,UDV)
> +Thread Group
> ++http smapler
> ++httpsampler
> ++for each controller   - > i don't want the for each to post each id. (If
> i read the file from a CSV file.)
> +++httpsampler
>
>
> Your input helps.
>
> -Shaba
>