-3

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?

2
  • "the text must be entered physically, not programmatically", and: robot.enterText(..)?. Commented 2 days ago
  • @MarcePuente it simulates physical key strokes Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.