jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Eagar <>
Subject new HTTPSampleResult() returns null. My Mistake or JMeter's?
Date Fri, 04 Nov 2005 22:52:38 GMT
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:

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.

Thanks for your time (and for JMeter),
Alex Eagar

Yahoo! Mail - PC Magazine Editors' Choice 2005

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message