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.
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.
- Support Appium
- Supports API requests
- Supported locators to find the UI elements