You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2008/07/01 12:18:34 UTC

Re: uploading files in jmeter

On 30/06/2008, Kristof Jozsa <dy...@ond.vein.hu> wrote:
> sebb wrote:
>
> >
> > >  I plan to run the test with around 100 concurrent users, so that means
> 100
> > > different files down- and then uploaded, but as I saw JMeter generates
> those
> > > filenames.. Is it possible to use a beanshell postprocessor to save the
> > > generated filename to a variable?
> > >
> > >
> >
> > The filename is stored in the SampleResult, and can be obtained as
> follows:
> >
> > sampleResult.getResultFileName()
> >
> > So you can add a BeanShell Listener with the script:
> >
> > vars.put("FILENAME",sampleResult.getResultFileName());
> >
> > Note that the Save Response element is actually processed as a
> > Listener, not a Post Processor, so you must use a Listener to extract
> > the value. [This is very confusing, so it needs to be fixed...]
> >
>
>  I thought it's not too confusing but seems I didn't get it then. I have a
> HTTP Request sampler which has two post processors: the 'save responses to a
> file' item and a beanshell script trying to set the FILENAME variable, but
> appearently the sampleResult is null here.

As I wrote, you need to use the BeanShell Listener, not a Post-Processor.

> I should add the Beanshell
> postprocessor to the Save Response element? How can I do that?
>

Not possible; Post-Processors only apply to samplers.

>
>  Kristof
>
>
> ---------------------------------------------------------------------
>  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


Re: uploading files in jmeter

Posted by Kristof Jozsa <dy...@ond.vein.hu>.
sebb wrote:
>>> The filename is stored in the SampleResult, and can be obtained as
>> follows:
>>> sampleResult.getResultFileName()
>>>
>>> So you can add a BeanShell Listener with the script:
>>>
>>> vars.put("FILENAME",sampleResult.getResultFileName());
>>>
>>> Note that the Save Response element is actually processed as a
>>> Listener, not a Post Processor, so you must use a Listener to extract
>>> the value. [This is very confusing, so it needs to be fixed...]
>>>
>>  I thought it's not too confusing but seems I didn't get it then. I have a
>> HTTP Request sampler which has two post processors: the 'save responses to a
>> file' item and a beanshell script trying to set the FILENAME variable, but
>> appearently the sampleResult is null here.
> 
> As I wrote, you need to use the BeanShell Listener, not a Post-Processor.


Sorry, my mistake. I wasn't aware that there's a separate beanshell 
listener available. Of course it works now.

Thanks,
Kristof

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