If a GUI test must involve entering text in a text field, a convenient shortcut is robot.enterText(..) (available in both FEST and its fork, AssertJ Swing).
I was under the impression the utility is smart enough to switch the keyboard layout if it doesn't match the text. Actually, it is not: all this time such a switch was done by my local utility application, Punto Switcher.
It means such tests are dependent on the keyboard layout which is unacceptable.
I know I can set a so-called "input locale" for any component which would in effect change the layout (component.getInputContext().selectInputMethod(..)). It would require explicitly setting the input locale in each such test before invoking robot.enterText(..). However, I was wondering whether I could do it a better way.
Note the text must be entered physically, not programmatically (field.setText(..)).
What is the best way to address this?