On 08/11/2008, Birendra <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I am creating a test plan which needs to create 1000 users or more by
> making registration for which unique user name and emailid parameters need
> to be provided with each thread of that request in the form of xml feed to
> be sent to the server as request parameter. Now I want to randomize the
> whole activity as I want to pass the diff user name and emaild during
> runtime through the use of BeanShell Scripting. I wish some BeanShell script
> could change the value of these two parameters at runtime. Though I am able
> to do the same thing by passing the diff feeds via .DAT file's each line per
> user. But I want to do it with the help of BeanShellScripting. Please help
> me.
Why is a data file not suitable?
Why do you particularly want to use BeanShell?
If you already have a script that uses variables derived from a data
file, then you can just replace the variable references with function
calls that return the required data.
i.e. instead of ${USERNAME} put ${__function_returning_username()}
where the function can be coded using Jexl, Javascript, BeanShell or
combinations of other existing functions:
http://jakarta.apache.org/jmeter/usermanual/functions.html
e.g. USER${__Random(1,1000)}
(Note that Random may return duplicates, but so will BeanShell
randomisation unless you are careful).
Equally, you could add a User Parameters Pre-Processor to re-define
the USERNAME variable using a function call as above.
Creating *unique* random variables can require a lot of storage.
You have use a random number generator and throw away any duplicates,
which means storing previous values. It is usually better to create
the random data beforehand.
If you don't care (too much) about uniqueness, then you can use the
existing __Random() function to build variables.
> Thanks
> Birendra Kr. Mishra
>
> --
> View this message in context:
> http://www.nabble.com/How-to-create-a-request-creating-1000-users.-tp20393765p20393765.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]