Selva123 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, Greetings. I want to test JAVA SWING application with PERL, do we have any module to do so (like win32::GUI for windows)?.I do not want JPL as the support for the same with windows is not proven. I am looking to enter and retrieve values from SWING applications apart from getting control info of the SWING components.
  • Comment on Is it possible to test swing applications using PERL

Replies are listed 'Best First'.
Re: Is it possible to test swing applications using PERL
by dHarry (Abbot) on Jul 06, 2010 at 11:57 UTC

    No experience doing that but the module Java::Swing jumps into mind.

    And please use Perl, Java and Swing instead of PERL, JAVA and SWING:P

      Thx for all the inputs.

      1.I can not make use of win32::GUiTest as this will not learn inside contents of AWT and hence I could not get/set controls.

      2. I just gone through Java::Swing which needs inline::java and also it tests the content being added by user rather than to work on exisitng/predefined Swing application.

      3.Thx for the comments of the word PERL usage, I will stick to Perl :)

        It looks like a hassle to do something that should not be so difficult. Do you really want to do it from/with Perl? Is it a hard requirement? It probably makes more sense to use a Java tool to do it. See open source testing tools in Java. for alternatives. Maybe you can integrate a call to one of those in your Perl test scripts?

        Cheers

        Harry

Re: Is it possible to test swing applications using PERL
by Corion (Patriarch) on Jul 06, 2010 at 12:35 UTC

    I think with automating Java applications, the standard approach is to inject your own robot implementation of the toolkit into the classpath, and then to access the elements of that robot toolkit.

    I'm unaware of such a toolkit, and even less aware of such a toolkit that also exports an interface that can be conveniently queried from the outside, for example using a TCP socket. So I guess you have to do screen-scraping using VNC or Win32::Screenshot to get at data, and send mouse clicks and keystrokes to drive the application.

Re: Is it possible to test swing applications using PERL
by bluescreen (Friar) on Jul 06, 2010 at 12:32 UTC

    Depending on the platform you want to run your tests from, you can either use Win32::GuiTest or X11::GUITest both are useful for creating automated tests over GUI applications.

    The catch here is that I don't think Swing's widgets behaves in same way that native widgets, but you can still send clicks and key presses ( probably good enough for testing purposes ). Look at the documentation, examples and test cases and you will understand how they work, I've used to test Visual Basic applications from Perl

Re: Is it possible to test swing applications using PERL
by marto (Cardinal) on Jul 06, 2010 at 11:58 UTC