You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by testerinCO <cm...@comcast.net> on 2011/11/28 20:51:09 UTC

Foreach Controller - Only extract 1st 20 values from list

I have a foreach controller with 100+ items, but I'm only interested in the
1st 20 items.  How can I restrict the controller to only extract the 1st 20
items and then quit?

Thank you.

--
View this message in context: http://jmeter.512774.n5.nabble.com/Foreach-Controller-Only-extract-1st-20-values-from-list-tp5029901p5029901.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Foreach Controller - Only extract 1st 20 values from list

Posted by sebb <se...@gmail.com>.
On 28 November 2011 19:51, testerinCO <cm...@comcast.net> wrote:
> I have a foreach controller with 100+ items, but I'm only interested in the
> 1st 20 items.  How can I restrict the controller to only extract the 1st 20
> items and then quit?

The ForEach Controller exits when the variable is not defined, so one
way to stop it early would be to delete the 21st variable.
This can be done in a post-processor just after the regex extractor.

The following script should work with BeanShell, Jexl etc.

vars.remove("REGEXVAR_21");

> Thank you.
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Foreach-Controller-Only-extract-1st-20-values-from-list-tp5029901p5029901.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Foreach Controller - Only extract 1st 20 values from list

Posted by Bruce Ide <fl...@gmail.com>.
Use a while controller and manually increment (In a BSF sampler) your
counter and manually set your truth condition?

-- 
Bruce Ide
FlyingRhenquest@gmail.com