I had the exact same problem and found to only solution was to create my own 
counter element, with a corresponding reset element:



Counter (Beanshell Pre-precessor):

c = Integer.parseInt(vars.get("count"));
c++;
vars.put("count", ""+c);



Reset/Initializer (Beanshell Pre-precessor):

vars.put("count", "0");



Regards,
noel

On Friday 20 February 2009 13:49:43 Massas wrote:
> Hello again all.
>
> I seem to have more problems..
>
> I'm having problems with variables in an embedded loop.
>
> From an regexp i get a variable which controls how many times a loop should
> run. In this loop, i want to use another variable which starts at 1 (lets
> give it the origninal name of ${counter}) and increments for each embedded
> loop. However, if looping the entire test case i always want to enter this
> embedded loop with the ${counter} value of 1.
>
> Here i have my problem. When running once, it works like a charm. But if i
> run the whole test case more than one loop the ${counter} keeps
> incrementing (not restarting at 1)
>
> Tring to put it in a more visual way:
>
> Thread group
> + Regexp out a variable (ex 3)
> + loop regexp variable times with ${counter}=1
> ++ do stuff in loop
> ++ ${counter}++
> + End of test
>
> On the next loop of the whole testcase the ${counter} will enter with the
> value of 4, but i need it to restart at 1. Is there a way to do this?
>
> Thanks in advance, and have a good weekend all.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to