The testing tools (or tools that could be used in testing purposes) for testing Java GUI application I know are:

  • Jemmy - library contains methods to reproduce all user actions which can be performed on Swing/AWT components (i.e. button pushing, text typing, tree node expanding, ...). Could be used with any Java IDE (Eclipse, NetBeans) & automated test framework (JUnit, TestNG) that gives you much freedom (e.g. analyze JVM memory usage).
    N.B.: looks like Jemmy does NOT support Java web-start applications (with downloading of .jnlp file) as it is mentioned in posts testing Java web-start app using Jemmy & how to automate a swing java web-start app, but still it is possible to test this kind of apps with great flexibility so I use this tool now. Testing app does not download & start .jnlp file, but starting script (vbscript) downloads .jar files of AUT (by the same link .jnlp file is downloaded) and testing app uses these files of a new AUT build.
  • Jubula - is an Eclipse based automated functional GUI testing framework for Java and HTML. Uses blocks as association with actions performed during test, developer does not write code just assembling test actions from available building blocks.
  • Sikuli - suits for testing any application (image recognition based) that does not require working with precise text data. The tool has it's limitations (check here), using it to test RDP stuff.
  • Abbot framework - for automated testing of Java GUI components and programs (did not study yet...)

What else can you suggest? Open source and for Java GUI testing.

  • Have you tried Selenium Webdriver? – IAmMilinPatel May 11 '16 at 3:34
  • 4
    @TESTasy, tried, but unfortunately it works only with web-applications. Selenium WEBdriver is not for GUI tests – Ivan Gerasimenko May 11 '16 at 6:50
  • I typically use AutoHotkey scripts to simulate keyboard presses and mouse movement. It's a bit hacky, but it gets the job done. It also works for automating applications if you don't have access to the source code. – Steven M. Vascellaro Aug 29 '17 at 16:52

If the Java GUI application is based on Swing, AssertJ Swing is probably one of the best open source libraries. It's a fork of FEST and has several advantages:

Moreover, it's actively maintained, offers a comprehensive documentation, supports Java 8, and AssertJ itself has some neat assertions.

However, if you ever consider a proprietary tool, I can highly recommend ReTest (disclaimer: I'm a software engineer at ReTest). The cool thing is that you don't have to specify assertions anymore as it works like a version control system—in terms of behavior—for the system under test (SUT). Furthermore, it offers AI-based monkey testing. That is, an artificially intelligent monkey can test the SUT 24/7.

  • 1
    Can AssertJ Swing be used to automate third party java web applets without having access to the source code? I couldn't find any way to gain access to an existing window from the documentation. – Steven M. Vascellaro Oct 6 '17 at 18:32

I know about several open source tools hosted on GitHub but didn't try them yet. Just created a list for future learning. Any additions and comments are welcome.

This list might be updated in the future. I'm maintaining it at the pywinauto project wiki page (pywinauto doesn't support Java at all, but Java GUI experts are very welcome).

  • Can these be used for third party Java Applets we don't have the source code for? – Steven M. Vascellaro Oct 6 '17 at 17:32
  • Probably yes. You can also check these applets with Inspect.exe tool which is available here. Some Java apps can be automated by pywinauto, but your chances are ~50% and it's Windows only. Didn't try other tools, just aware of them. :) – Vasily Ryabov Oct 6 '17 at 18:12
  • So you wouldn't be able to demonstrate the usage for these tools? – Steven M. Vascellaro Oct 6 '17 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.