14

I'm currently reading the book Growing Object-Oriented Software Guided by Tests which gives a decent introduction into test driven development.

One drawback is that the code developed through the book is based on Swing. For my next project I'd like to use Java FX 2 and I'm wondering if there are any GUI testing frameworks out there for it? The book introduces windowlicker, which allows testing Swing applications only.

assylias
  • 321,522
  • 82
  • 660
  • 783
mAu
  • 2,020
  • 1
  • 14
  • 27

7 Answers7

22

There's yet another new testing library for JavaFX called TestFX.

minisu
  • 1,000
  • 6
  • 11
  • 3
    I've started using it and it is significantly easier to use than JemmyFX - Thanks for the good work! – assylias Jan 27 '14 at 11:06
  • 1
    We had massively used JemmyFx in the past and we are now switching to TestFX. It is far superior IMHO. It is really simpler (Bye bye `Dock`, `Wrap`, `Parent`...) and nicely integrated with junit. I wrote also some headless test using `Monocle` and it works well too. – gontard Mar 16 '15 at 10:44
  • I just created a stackoverflow tag for [tesfx](http://stackoverflow.com/questions/tagged/testfx) – gontard Mar 16 '15 at 10:45
17

There is a library named JemmyFX. Jemmy itself is a set of libraries and tools to test UI applications (mostly Java-based: Swing, AWT, SWT; but it's being extended to native right now). JemmyFX covers JavaFX for that matter.

JemmyFX can be downloaded as a part of the test branch of OpenJFX 2 (open-sourced part of JavaFX).

For JavaFX 8, the test branch includes support for new controls and other fixes.

assylias
  • 321,522
  • 82
  • 660
  • 783
Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
  • Thanks. But as far as I can see it's for Java FX 1.x not Java FX 2.x. – mAu May 15 '12 at 12:39
  • there is a library for both of them! Take a look at bottom link. – Sergey Grinev May 15 '12 at 12:42
  • 3
    Note, that JemmyFX is a supported and developed project, and it has its own tag on stackoverflow : "jemmy", you can file issues on it in javafx-jira under jemmy project, and if you wish additional features, you can suggest them. – Alexander Kirov Jun 11 '13 at 10:53
6

There's a new test robot called MarvinFX:

MarvinFX has the goal to easily test JavaFX controls and scenes with a special attention on properties.

This other post shows how to use assertions and rules with MarvinFX.

assylias
  • 321,522
  • 82
  • 660
  • 783
Chui Tey
  • 5,436
  • 2
  • 35
  • 44
5

Another library (which I have not used or tested) is TestComplete.

assylias
  • 321,522
  • 82
  • 660
  • 783
5

Automaton is another testing library for JavafX and Swing GUIs born out of the same team that did TestFX

  • easy tests for Swing and JavaFX applications
  • written for testers. Only basic coding skills required.
Brian Blonski
  • 1,762
  • 18
  • 23
1

According to Eclipse site, the modern testing tools for JavaFX in the year 2015 are Squish and Jubula . But Squish is commercial. And Jubula is partly free - JavaFX belongs to that free part. And in the Eclipse Mars version already exists the testing distribution. Uses Jubula for UI testing.

Gangnus
  • 24,044
  • 16
  • 90
  • 149
1

Jubula is now totally free, and does indeed support JavaFX.

Alex
  • 31
  • 1