Question

Is it possible to write tests for a JavaFX application, which do not fail upon mouse mouvement generated by the human user ?

I am a beginner in JavaFX and TestFX, and it seemed to me that TestFX stops everything as soon as it detects that the mouse has been moved. In another project, which uses Eclipse RCP and SWTBot, this seemed to work out-of-the-box, as long as the application under test had the focus. Is there any way to get the same behaviour with TestFX, or any other test framework for JavaFX ?

Was it helpful?

Solution

As a workaround, on Linux, it's generally advised and useful to create another X session (using Xephyr for example) and to run tests in this X session by setting the right DISPLAY property. With that, the event processing is isolated on both DISPLAYs so tests are not "polluted" by parallel human actions on the other DISPLAY and can run with less troubles.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top