jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: How to execute a Java method from the JMeter GUI
Date Thu, 14 Oct 2010 16:46:12 GMT
For quick and dirty prototyping Use BeanShell (http://www.beanshell.org/).
Usually the activities you describe are by adding a pre processor or post
processor to the sampler (but you can also use BeanShell samplers and/or
Listeners).
The entire java API is available along with some JMeter variables as
described here
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_PreProcessor
The javadocs for the Jmeter classes are
http://jakarta.apache.org/jmeter/api/index.html

so for e.g. to set something into the variables would be
vars.put("key","value");

to get access to the cookie manager would be
sampler.getCookieManager();
Errors in syntax will be reported to bin/jmeter.log

To use your own java classes copy the jar to JMeter/lib, import and use as
in any java class.


You also have a Java Sampler that you can use
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Java_Request
You just implement an interface and write your implementation to do whatever
you want


regards
deepak

On Thu, Oct 14, 2010 at 9:34 AM, sheerazmemon <bigonotation@gmail.com>wrote:

>
> Hi,
> Can someone please assist in giving explicit steps on how to execute a
> simple java method from the JMeter GUI? Alternatively, can someone give
> steps on how to execute a shell script from the JMeter GUI?
>
> I just need to do some computation during load testing run time in order to
> get cookies for specific users, and will then assign those cookie values to
> variables that I can use in the Test Plan.
>
> Will really appreciate your responses.
>
> Thanks.
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/How-to-execute-a-Java-method-from-the-JMeter-GUI-tp3212388p3212388.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message