On 20 January 2012 18:06, Oliver Lloyd <[email protected]> wrote:
> If I have 1 to n threadgroups in a testplan is it possible to loop through
> them setting a property for each?
>
> So, what I want to do is pass in a property to the test - simple enough -
> and then use this property to affect the number of threads per threadgroup.
> Each group will have varying numbers of threads assigned to it and there may
> be more or less thread groups per test plan. I want a way to, say, pass in a
> value of 2 and divide the thread value for each thread group dynamically.
>
> Imagine:
>
> Test Plan
> --TG1
> ----Some samples
> --TG2
> ----Some samples
> --TG3
> ----Some samples
> ...
> etc.
>
> I can set the value for each group to Number of Threads to
> ${__P(test.myvalue,10)} and then pass in myvalue but I'm using a script to
> call JMeter and it is not aware of the testplan structure so it cannot
> decide on the count of users to pass in - it can only decide that it wants
> to divide every value by 2. Therefore the calculation must occur inside the
> testplan.
The following value for Number of threads:
${__jexl2(10/5)}
results in 2 threads being run
Replace 10 and or 5 with appropriate variable references.
> Something like:
> For each threadgroup in allThreadGroups
> tg.countOfThreads=tg.countOfThreads/test.myvalue
> next
>
> Ideally, this can be done using one preprocessor at the root of the main
> testplan but maybe it has to be a separate preprocessor for each thread
> group?
>
> Thanks for your time
> Oliver
>
>
> -----
> http://www.http503.com/
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Can-you-loop-through-thread-groups-dynamically-tp5161267p5161267.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]