For future reference: it seems to work smoothly.
It took most of my time to figure out I needed to download the bsh jar
file to $JMETER_HOME/lib.

For ${discriminator} I used ${__threadNum}.
The PUT request uses /tmp/requestbody-${__threadNum}.

Currently the beanshell script is executed once for every thread
iteration so the file gets regenerated every time.  It is not really
necessary (and probably causing a lot of overhead), but it could
probably use a variable to generate the file only once for every thread.

Regards,
Karel

On Mon, 2008-08-18 at 15:13 +0200, Karel Vervaeke wrote:
> Hi, I am writing a load test for an application and I need to send
> PUT requests where the request body contains variable data.
> 
> I have a (theoretical) strategy for solving it, but I would like to know
> if there are better ways to do it.
> 
> My current strategy is like this:
> 
> ThreadGroup
>   + BeanShell script to create /tmp/requestbody-${discriminator}.xml
>   + Sampler PUT /testme/123 => PUTs the 
>   + BeanShell script to clean up /tmp/requestbody-${discriminator}.xml
> 
> The ${discriminator} variable should be unique per thread so that each
> thread can read/write to its own file.
> 
> Do you think this is a valid approach or am I going to hit some walls?
> Is there another (better) approach?
> 
> Regards,
> Karel
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to