Jemmy V2 - question (test-automation, blackbox)

Alexandre (Shura) Iline alexandre.iline at oracle.com
Tue Oct 2 15:51:02 UTC 2018


> From: Rev Kapuganti <rev.sdet at gmail.com <mailto:rev.sdet at gmail.com>> 
> Sent: Tuesday, October 02, 2018 7:50 PM
> To: Muneer Kolarkunnu <abdul.kolarkunnu at oracle.com <mailto: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 <mailto:jemmy-dev at openjdk.java.net> . Can you please confirm you sent email to jemmy-dev at openjdk.java.net <mailto: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 <mailto:rev.sdet at gmail.com>> 
> Sent: Tuesday, October 02, 2018 7:50 PM
> To: Muneer Kolarkunnu <abdul.kolarkunnu at oracle.com <mailto: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