TestFX in headless mode

642 views
Skip to first unread message

Naimdjon Takhirov

unread,
Jul 22, 2014, 9:28:33 AM7/22/14
to testfx-...@googlegroups.com
Hi,

I am quite new to TestFX and currently exploring possibilities of using it as a testing framework for the GUI module of our application. The Jenkins node that executes the tests now is failing because it does not have access to the graphical session when running the tests. When I looked at the generated screenshot it is just black with no graphical elements on it. 

I read some places that JavaFX cannot be run in headless mode, though this is apparently planned feature in Monocle implementation of Glass in the update 20 (currently in beta). I also saw RT-20494 and RT-20510 which are open issues with no recent progress. Even running the beta 8u20 to execute tests, the Monocle implementation is not found (tests fail with ClassNotFoundException).

So, I therefore wonder whether the only way to make my setup work is to implement FxRobot to use MonacleRobot as suggested in this blog post?

Naimdjon

Benjamin Gudehus

unread,
Jul 22, 2014, 9:42:51 AM7/22/14
to Naimdjon Takhirov, testfx-...@googlegroups.com
Hi!

There are two possible solutions. Use the X virtual framebuffer with Jenkins or implement a custom ScreenRobot.

1. To test TestFX with Travis CI we use the X virtual framebuffer. Maybe you could instruct Jenkins to use this.
Here is a snipped from ".travis" in master:
before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

2. I didn't use Monocle so far, but the blog posts states that it works with a custom implementation
of ScreenRobot (MonacleRobot) passed into FxRobot.

P.S.: Also I'm currently writing an technical "500 word essay" on the core concepts of TestFX, with brief
reflection on the past and proposals for the future. I'll put some words on the transition from
java.awt.robot to com.sun.glass.ui.Robot and Monacle into the essay.

Regards
Benjamin


--
You received this message because you are subscribed to the Google Groups "TestFX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testfx-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages