jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: How to pass a variable as a parameter to random function
Date Tue, 12 Jun 2007 22:25:58 GMT
On 12/06/07, bvm101 <boban_mn@yahoo.com> wrote:
>
> Within a BeanShell PreProcessor I have a following code:
>
> java.util.List ids = new java.util.ArrayList();
> ids.add("key1");
> ids.add("key2");
> ids.add("key3");
>
> int clientSize = ids.size();
>
> ${__Random(0,3 ,myRandom)};

The above line should give the clue ... try

 ${__Random(0,${clientSize} ,myRandom)};

> vars.put("Col_65537", ids.get(${myRandom}));
>
>
> However, when calling random function I would like to pass a variable for
> the max value, in this case "clientSize", instead of number 3.
>
> Your help will be greatly appreciated.

If your test uses this Pre-processor a lot, you may find you get memory leaks.

You could put the code in an init file, and then call a method passing
in the Random number.

> Thanks,
>
> Boban
> --
> View this message in context: http://www.nabble.com/How-to-pass-a-variable-as-a-parameter-to-random-function-tf3909593.html#a11085352
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Mime
View raw message