I am looking for a free tool to create automated test scripts for a Java-Swing application. I found Sikuli, but it wasn't updated years ago and seems to be an unstable solution. Winium looks obsolete too, it wasn't developed in the last few years as can be seen in their GitHub repository.
-
1What Java GUI technology? JavaFX, Swing, AWT, SWT, … ?– beatngu13Apr 3, 2018 at 20:13
-
@beatngu13 : It is a Swing application, but I am interested in multi-purpose frameworks too.– plaidshirtApr 4, 2018 at 6:16
-
1Multi-purpose means less optimization and less focus on the single task I need to solve right now. Sometimes the compromise is worth the price, but often it is not. Vendors of IT technology do have inherent interest to design their technology in a way not compatible with other vendors so it is harder to switch to competitors: it is called Vendor lock-in and some companies (Microsoft, Oracle) are famous for using it.– Peter M. - stands for MonicaApr 4, 2018 at 14:46
2 Answers
Sikuli is deprecated as mentioned on GitHub:
A new version of Sikuli(X) is available since 2013 as a follow up development
SikuliX seems pretty active when you look at their GitHub. Haven't worked with SikuliX myself, but they say they use OpenCV (i.e. computer vision) to interact with anything on the screen. Seems like a reasonable approach when you're interested in a tool that can do more than Swing.
Winium won't help you because it only supports applications that are based on either WinForms or WPF.
Personally, I prefer native solutions. I've never been a friend of (pure) computer vision-based tools because usually you get faster and more stable tests when you have a tool that knows the underlying GUI technology (like Selenium or Appium). When it comes to Swing and you're looking for a free solution, AssertJ Swing is probably one of the best open source libraries. It's a fork of FEST and has the following features:
- Simulation of user interaction with a GUI (e.g. drag 'n drop)
- Reliable GUI component lookup (by type, by name or custom search criteria)
- Support for all Swing components included in the JDK
- Compact and powerful API for creation and maintenance of functional GUI tests
- Supports Applet testing
- Ability to embed screenshots of failed GUI tests in HTML test reports
- Can be used with either TestNG or JUnit
- Supports testing violations of Swing's threading rules
- Can be used with JIDE Software (since 1.1.0)
Moreover, it's actively maintained, offers a comprehensive documentation, supports Java 8, and AssertJ itself has some neat assertions.
For automating a window based application try WinAppDriver. A UI test automation tool for Window based applications. (https://github.com/Microsoft/WinAppDriver). It includes Appium to test the UI of a Window based application.
Features :
- Support Appium
- Supports API requests
- Supported locators to find the UI elements