Quantcast

Using JMeter with a Java Swing Application

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using JMeter with a Java Swing Application

RBRB
Has anyone used JMeter with a client-server Java application whose front-end is written in Swing?  The application runs in Weblogic and accesses an Oracle database.  The question is how to launch the application's login screen and record the clicks to create the scenario under test?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

shettyd
You cannot use Jmeter for this.



On Tue, Feb 9, 2010 at 4:01 PM, RBRB <[hidden email]> wrote:

>
> Has anyone used JMeter with a client-server Java application whose
> front-end
> is written in Swing?  The application runs in Weblogic and accesses an
> Oracle database.  The question is how to launch the application's login
> screen and record the clicks to create the scenario under test?
> --
> View this message in context:
> http://old.nabble.com/Using-JMeter-with-a-Java-Swing-Application-tp27524214p27524214.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

RBRB
Thank you for the response.  JMeter has some built-in samplers such as JavaRequest and the control panel of JavaRequest has a combo-box that displays classes that JMeter has found in its lib/ext.  Can someone write a custom sampler calling the entry-point class of the application under test?

Deepak Shetty wrote
You cannot use Jmeter for this.



On Tue, Feb 9, 2010 at 4:01 PM, RBRB <reza.bahmanyar@blackrock.com> wrote:

>
> Has anyone used JMeter with a client-server Java application whose
> front-end
> is written in Swing?  The application runs in Weblogic and accesses an
> Oracle database.  The question is how to launch the application's login
> screen and record the clicks to create the scenario under test?
> --
> View this message in context:
> http://old.nabble.com/Using-JMeter-with-a-Java-Swing-Application-tp27524214p27524214.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
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

shettyd
you can call any java class that you want(beanshell java sampler). Its more
difficult to type in fields in the GUI application (you'd probably have to
use the Robot class). If you are going to code this yourself then you might
as well use a tool that already does this I think there were some open
source tools that could drive swing GUI's , check with google!
(Thick GUI's cant really be load tested , you could only perform functional
test)

What you can do is your Swing Client communicates with the weblogic app
using some protocol (EJB, WebServices RMI HTTP whatever). You can test the
weblogic app using JMeter (which would act as the client using the same
protocol). You cant test the swing parts.

regards
deepak



On Tue, Feb 9, 2010 at 5:05 PM, RBRB <[hidden email]> wrote:

>
> Thank you for the response.  JMeter has some built-in samplers such as
> JavaRequest and the control panel of JavaRequest has a combo-box that
> displays classes that JMeter has found in its lib/ext.  Can someone write a
> custom sampler calling the entry-point class of the application under test?
>
>
> Deepak Shetty wrote:
> >
> > You cannot use Jmeter for this.
> >
> >
> >
> > On Tue, Feb 9, 2010 at 4:01 PM, RBRB <[hidden email]>
> wrote:
> >
> >>
> >> Has anyone used JMeter with a client-server Java application whose
> >> front-end
> >> is written in Swing?  The application runs in Weblogic and accesses an
> >> Oracle database.  The question is how to launch the application's login
> >> screen and record the clicks to create the scenario under test?
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Using-JMeter-with-a-Java-Swing-Application-tp27524214p27524214.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Using-JMeter-with-a-Java-Swing-Application-tp27524214p27524726.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

srinivas
This post has NOT been accepted by the mailing list yet.
In reply to this post by shettyd
Can I Test my Swing Application with JMeter ?
Please guide me.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

dheeraj
This post has NOT been accepted by the mailing list yet.
In reply to this post by RBRB
is it possible to link the GUI of jmeter with a java application to pass values to jmeter and get the response back ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

glinius@live.com
This post has NOT been accepted by the mailing list yet.
If your Java application talks to the server using HTTP protocol you should be able to record these requests using JMeter's HTTP Proxy Server as follows:

 1. Pass the next arguments to your Java client application:

http.proxyHost=X.X.X.X
http.proxyPort=YYYY
where X.X.X.X is the IP address of JMeter host and Y.Y.Y.Y is JMeter's proxy port.

Aforementioned options can be passed as command-line arguments via -D key. See How do I set the proxy to be used by the JVM for details.

Once you recorded your application traffic you can replay it with higher number of threads.  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using JMeter with a Java Swing Application

dheeraj
This post has NOT been accepted by the mailing list yet.
that sounds like something good.
i have found a code that does something like this


package javaapplication5;

import org.apache.jmeter.control.LoopController;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.threads.SetupThreadGroup;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;

public class JMeterTestFromCode {

    public static void main(String[] args){
        // Engine
        StandardJMeterEngine jm = new StandardJMeterEngine();
        // jmeter.properties
        JMeterUtils.loadJMeterProperties("C:/TMP/jmeter.properties");

        HashTree hashTree = new HashTree();

        // HTTP Sampler
        HTTPSampler httpSampler = new HTTPSampler();
        httpSampler.setDomain("www.google.com");
        httpSampler.setPort(80);
        httpSampler.setPath("/");
        httpSampler.setMethod("GET");

        // Loop Controller
        TestElement loopCtrl = new LoopController();
        ((LoopController)loopCtrl).setLoops(1);
        ((LoopController)loopCtrl).addTestElement(httpSampler);
        ((LoopController)loopCtrl).setFirst(true);

        // Thread Group
        SetupThreadGroup threadGroup = new SetupThreadGroup();
        threadGroup.setNumThreads(1);
        threadGroup.setRampUp(1);
        threadGroup.setSamplerController((LoopController)loopCtrl);

        // Test plan
        TestPlan testPlan = new TestPlan("MY TEST PLAN");

        hashTree.add("testPlan", testPlan);
        hashTree.add("loopCtrl", loopCtrl);
        hashTree.add("threadGroup", threadGroup);
        hashTree.add("httpSampler", httpSampler);

        jm.configure(hashTree);

        jm.run();
    }
}


but i am still not able to connect java program to jmeter.
can anyone please give a working code or modified piece of this code?
thanks.
Loading...