I have a testing FEST app which uses an AWT robot for simulating certain actions over a Swing interface. My problem is that it seems like moving the mouse pointer during the robot-test execution cancels some of the programatic actions, like pressing a column header. If you dont touch anything during execution, then cursor moves alone to the target and hits it.
Is there any way to block mouse user input for that app until test is finished?
Maybe not a block but a way to ignore events, force EDT finish or shielding robot would be appreciated of course
Maybe you could disable the keyboard and mouse using the native terminal commands. I.e cmd.exe for Windows and terminal for Linux (depending if application has to be portable just check os name and then run the correct command) however I'm not sure if this would render the
Robot
useless. I think not though.Windows:
and for Linux see here
Addendum:
In my knowledge it is not possible in pure Java without using JNI to disable keyboard and mouse input from the user.
Here is a great link for the disbaling mouse and keyboard using JNI in Java: Java Global Keyboard / Mouse Hook - JNI