Closed renatoathaydes closed 8 years ago
Hi Renato!
What were the problems related to java.awt.MouseInfo
?
Update: Seems the problem was this:
java[1129:707] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
Hello!
Not sure if that was the only problem, people using Mac say it's not working.... I have the same issue as you, no Macs easily available to test :) My girlfriend just bought one, though, so I might steal it from her and try to work around this issue one day!
With https://github.com/TestFX/TestFX/pull/126 the test suite of TestFX passed nearly all tests on OSX (tested with JDK 1.7.0_60 and 1.8.0_05 on OSX 10.8). It only failed the tests with different OS-specific user inputs. So it seems to work now, but I'm not quite sure if it works on all circumstances.
The important change was to set javafx.macosx.embedded
.
System.setProperty("javafx.macosx.embedded", "true");
Application.launch(appClass, appArgs);
The current code creates a new java.awt.Robot
and then can call Application.launch()
and retrieve the primary Stage
.
It can also call
Platform.runLater()
,java.awt.MouseInfo.getPointerInfo().getLocation()
,java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()
androbot.createScreenCapture(new Rectangle(0, 0, 100, 100))
.Thank you for the information... I wonder why Oracle would require this system property to be set to true
to let things work!
Seems that Glass was not able to detect this automatically in OSX before Java 1.8 (Lombard) [1].
Could anyone try Automaton 1.1.0, which I just released, in Mac and see if it works, please?
http://jcenter.bintray.com/com/athaydes/automaton/Automaton/
Would really appreciate, thanks.
Don't know when or how.. but automaton is working fine in Mac with current versions.
Fixed the Robot, but in Mac other problems still occur related to MouseInfo.