Jemmy V2 - question (test-automation, blackbox)
Rev Kapuganti
rev.sdet at gmail.com
Tue Oct 2 22:50:49 UTC 2018
Ok, Got it, Thanks Shura for all the suggestions.
Rev
On Tue, Oct 2, 2018 at 2:49 PM Alexandre (Shura) Iline <
alexandre.iline at oracle.com> wrote:
> Rev,
>
> It is hard for me to answer your questions without knowing the specifics,
> sorry.
>
> From what you are saying, it looks like that you will have to modify more
> than one line in the launch script - could be so.
>
> Shura
>
> On Oct 2, 2018, at 10:10 AM, Rev Kapuganti <rev.sdet at gmail.com> wrote:
>
> Thank you Shura, thats great details. Out of all the options you have
> recommended, I believe the below option sounds feasible because of the
> complexities and different custom parameters (configs )required for
> launching this heavy loaded OR-POS application and also my test automation
> framework of choice(Jruby based - runs on JVM). Unfortunately a simple
> java invocation of the main class with java_options and application params
> wouldn't do it.
>
>
> Preferred option -
>
> If, for whatever reason, it is not possible to start the app from the
> harness setup methods, you can try to modify the batch file of yours by
> inserting your own class in front of the application main class which, the
> way I imagine your script, you already have in the line where java binary
> is called.
>
>
> My question with this option is - My test suite(cucumber) entry point is
> a ruby-file( cucumber's env.rb : which creates an instance of Object class)
> and it then calls all the tests under the suite directory. I'm also using a
> bunch of JARs for doing a bunch of other things(to talk to databases, my
> simulation servers, reporting apps and others). I would like to mix in
> jemmy here for talking to the GUI of swing app.
>
> This cucumber suite(since its Jruby) is run on JVM through
> command-line(for example: Jruby -S cucumber -p test-profile). Are you
> recommending somehow adding this invocation along with the POS app's main
> class while launching it through the batch file?
>
>
>
>
>
>
> On Tue, Oct 2, 2018 at 11:51 AM Alexandre (Shura) Iline <
> alexandre.iline at oracle.com> wrote:
>
>> *From:* Rev Kapuganti <rev.sdet at gmail.com>
>> *Sent:* Tuesday, October 02, 2018 7:50 PM
>> *To:* Muneer Kolarkunnu <abdul.kolarkunnu at oracle.com>
>> *Subject:* Fwd: Jemmy V2 - question (test-automation, blackbox)
>>
>>
>> Hello Abdul. This is realated to a question that I have on Jemmy usecase
>> which I posted on Jemmy-dev list. I'm also trying to reach out to you as I
>> haven't heard from the developer mailing list. Any help would be greatly
>> appreciated.
>>
>> Please find the posted below:
>>
>>
>> Hello Jemmy devs -
>>
>> Firstly great work! I understand that in order to use jemmy v2 - SUT(in
>> my case its a SWING front-end with ORPOS backend) needs to be launched on
>> the same JVM instance that the test runs. I have a question(related to
>> that). Any help/suggestion is greatly appreciated.
>>
>>
>> That assumption is absolutely correct. Jemmy v2 is working by requesting
>> information from the AWT component hierarchy, and by calling component
>> methods. Jemmy v2 is accessing the AWT API to get the necessary knowledge
>> about the UI and also to post events to simulate user input or it is using
>> Robot API for the same purpose.
>>
>>
>> My app under test needs a config xml(that points to bunch of other config
>> files in the class path) along with JAVA OPTIONS passed to the main class
>> in order to get launched. Currently its a command line launcher through a
>> batch file. How do I approach launching this via Jemmy tests? I see a
>> ClassReference method - startApp, but does it support complex parameters
>> like in my case?
>>
>>
>> There are two general ways to run test code and the app code in the same
>> VM: run test code from the application or run the application from the test
>> code. The former would require modifying the original app, which may be
>> harder than to implement the latter. To run the app from test, the most
>> scalable approach is to just run the main class of the application from
>> appropriate lifecycle methods of a test harness, such as TestNG or JUnit.
>> After all, running a Java app is just running a main class with possible
>> preparations and environment setting.
>>
>> If, for whatever reason, it is not possible to start the app from the
>> harness setup methods, you can try to modify the batch file of yours by
>> inserting your own class in front of the application main class which, the
>> way I imagine your script, you already have in the line where java binary
>> is called.
>>
>>
>> Or do you recommend a different approach where I can run my app with
>> jemmy agent(like solution) so I can reference the java objects from the
>> running app later through my blackbox tests.
>>
>>
>>
>> The other approach to run some auxiliary code in every VM, is called
>> "accessibility hook". That used to work before - I have not tried it in
>> years. It would require changing some property files in the JDK install
>> dir. I would not recommend looking into this approach unless you absolutely
>> have to.
>>
>> Shura
>>
>>
>>
>> Thanks in advance, appreciate any help.
>>
>> Rev
>>
>>
>>
>> On Oct 2, 2018, at 8:18 AM, Muneer Kolarkunnu <
>> abdul.kolarkunnu at oracle.com> wrote:
>>
>> Hi Rev,
>>
>> We haven’t received this email in jemmy-dev at openjdk.java.net . Can you
>> please confirm you sent email to jemmy-dev at openjdk.java.net only?
>> Forwarding this to jemm-dev mailing list.
>>
>> Shura,
>> Rev’s email hasn’t come to jemmy-dev mailing list. I also had same issue
>> when I was sending emails to this mailing list in the initial days and
>> somehow it got corrected. Can you please check.
>> Also can you please reply to his query.
>>
>> Regards,
>> Muneer
>>
>> *From:* Rev Kapuganti <rev.sdet at gmail.com>
>> *Sent:* Tuesday, October 02, 2018 7:50 PM
>> *To:* Muneer Kolarkunnu <abdul.kolarkunnu at oracle.com>
>> *Subject:* Fwd: Jemmy V2 - question (test-automation, blackbox)
>>
>>
>> Hello Abdul. This is realated to a question that I have on Jemmy usecase
>> which I posted on Jemmy-dev list. I'm also trying to reach out to you as I
>> haven't heard from the developer mailing list. Any help would be greatly
>> appreciated.
>>
>> Please find the posted below:
>>
>>
>> Hello Jemmy devs -
>>
>> Firstly great work! I understand that in order to use jemmy v2 - SUT(in
>> my case its a SWING front-end with ORPOS backend) needs to be launched on
>> the same JVM instance that the test runs. I have a question(related to
>> that). Any help/suggestion is greatly appreciated.
>>
>> My app under test needs a config xml(that points to bunch of other config
>> files in the class path) along with JAVA OPTIONS passed to the main class
>> in order to get launched. Currently its a command line launcher through a
>> batch file. How do I approach launching this via Jemmy tests? I see a
>> ClassReference method - startApp, but does it support complex parameters
>> like in my case?
>>
>> Or do you recommend a different approach where I can run my app with
>> jemmy agent(like solution) so I can reference the java objects from the
>> running app later through my blackbox tests.
>>
>>
>> Thanks in advance, appreciate any help.
>>
>> Rev
>>
>>
>>
>
More information about the jemmy-dev
mailing list