I dont know why you want to do this since your requirements are satisified
without BeanShell, anyway,


 the Sample Result is something that is passed to you , you dont have to
create it
>From here
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_PostProcessor
You get
prev - (SampleResult) - gives access to the previous SampleResult
And from
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html#getResponseHeaders()
you get the correct method name

so
String str = prev.getResponseHeaders();

> log.info(str);


if you have errors in code you should see it in jmeter.log



On Tue, Aug 17, 2010 at 1:34 AM, Sriharsha Setty
<[email protected]>wrote:

> Hi Deepak,
>
>
> On Wed, Aug 4, 2010 at 10:50 PM, Deepak Shetty <[email protected]> wrote:
>
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_PostProcessor(note<http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_PostProcessor%28note>
> <
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_PostProcessor%28note
> >
> > the The following BeanShell variables are set up for use by the
> > script: ) and read about the objects at
> > http://jakarta.apache.org/jmeter/api/index.html
> >
> >
> After giving it a thought, I've decided that I should parse the response
> data using a BeanShell PostProcessor.
> I am adding a BeanShell PostProcessor to a HTTP Sampler (does a POST;
> receives an XML response).
>
> I am not too familiar with Java, so to start off, I wrote the following
> snippet to understand if I am doing it right. I expect the HTTP response
> header to be printed in jmeter.log, but I don't see it. I am doing
> something
> wrong here or have I missed doing something completely?
>
>
> import org.apache.jmeter.protocol.http.samplers.SampleResult;
> SampleResult sr = new SampleResult();
> String str = sr.getResponseHeadersAsString();
> log.info(str);
>

Reply via email to