jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: new HTTPSampleResult() returns null. My Mistake or JMeter's?
Date Mon, 07 Nov 2005 17:20:25 GMT
On 04/11/05, Alex Eagar <alexeagar@yahoo.com> wrote:
> JMeter v. 2.1.1 with bsh-2.0b4.jar and j2sdk1.4.2_10
> on Windows XP SP2.
>
> --- The Problem ---
> Within a BeanShell Sampler, I have the following:
> import
> org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
>
> HTTPSampleResult res = new HTTPSampleResult();
>
> print("res == " + res);
>
> When run, the terminal prints the following:
> res == null
>
> --- Info Found ---
> HTTPSampleResult Constructor Definition:
> public HTTPSampleResult() {super();}
>
> HTTPSamplerResult extends SampleResult
> SampleResult Constructor Definition:
> public SampleResult() {time = 0;}
>
> --- Another Problem ---
> If the above is my mistake, then the following is not
> a problem, but if it is JMeter's mistake then I think
> it would be another problem. Please correct my logic
> if I'm not seeing how this all works.
>
> HTTPSampler, method setupConnection(URL u, String
> method, HTTPSampleResult res)
> The argument res is supposed to get set up but if res
> is null, it never happens.
> Line 154, the beginning of res setup:
> if (res != null) {
>
> --- Comment/Background ---
> I am trying to learn how to use JMeter elements
> programmatically from a BeanShell Sampler for more
> flexible control. Besides the general increased
> flexibility, right now I am trying to make a web
> crawler. If you can point me in the direction of
> documentation on how to control elements from a
> BeanShell Sampler, please tell me; I will appreciate
> it very much.

BeanShell Sampler was not designed for such usage.

Sorry, but I've no idea whether or not this can be made to work.

Try checking jmeter.log in case there are any error messages to show
why res==null.

> Thanks for your time (and for JMeter),
> Alex Eagar
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.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