JemmyFX vs TestFX
Recently I have had the chance to work with JavaFX, the new UI platform built into Java. My main task was to provide a library of reusable UI components, and I wanted to make sure they were rock-solid.
One way of doing so is to use automated integration testing. Basically, you write a JUnit test which brings up the user interface, executes IO events like mouse drags or key presses, and then you test the state of the user interface.
I first created a test suite using JemmyFX. JemmyFX seemed very promising at first, but in hind-sight, that may just have been my amazement at being able to automatically do user interface testing. It turns out that JemmyFX tests are really sensitive to timing issues, which is a huge issue when your tests work okay on your development machine, but the moment you push them to the CI server, they fail. JemmyFX also had great difficulty finding PopUp controls. Perhaps even worse, JemmyFX tests are very verbose, which causes developers to write fewer tests.
Enter TestFX; No more timing issues, and even though the tests I ported had the same test coverage, line count went down 30 to 40%. I had written all these special classes to bootstrap an application to execute tests on different controls in JemmyFX, I no longer needed those either. TestFX will let you write multiple test-cases which will all execute without problem in the same VM process.






