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 <[email protected]>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: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to