I don't believe that java provides any API for querying the state of any keys on the keyboard. The only access to modifier key state is by examining a key press/release or mouse press/release event. Suggestions are welcome.
This is the same category of failure as having your mouse set up to be left-handed, or changing its tracking speed, on w32. Both will cause Java to improperly generate/track events via java.awt.Robot, and thus require the machine be in a particular known state before running the tests.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've added detection in the editor to detect some bugs caused by w32 settings. I'll put on the TODO list to reset the caps lock/num lock settings on startup to ensure that they're in a known state.
Monitor/screen resolution will not affect abbot's operation, nor will changes in LAF. Changes in component position and/or size will also not cause any problems. Most hierarchy changes will also be ignored.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The MyCode-1.xml script fails the last assertion when the caps-lock is active. Is there a way to assert something about the state of the caps key?
I don't believe that java provides any API for querying the state of any keys on the keyboard. The only access to modifier key state is by examining a key press/release or mouse press/release event. Suggestions are welcome.
This is the same category of failure as having your mouse set up to be left-handed, or changing its tracking speed, on w32. Both will cause Java to improperly generate/track events via java.awt.Robot, and thus require the machine be in a particular known state before running the tests.
This is troubeling. My concern is that a test written on one developer's machine may not work on another machine.
How about other parameters like screen resolution or screen position?
As for actually detecting this sort of state, you may want to look into JConfig:
http://www.tolstoy.com/samizdat/jconfig.html
I'm not sure if it actually supports things like caps lock detection, but it's worth a look.
I've added detection in the editor to detect some bugs caused by w32 settings. I'll put on the TODO list to reset the caps lock/num lock settings on startup to ensure that they're in a known state.
Monitor/screen resolution will not affect abbot's operation, nor will changes in LAF. Changes in component position and/or size will also not cause any problems. Most hierarchy changes will also be ignored.