Key.TAB not behaving as expected in a text box.

Asked by David Eells on 2021-03-08

A member of my team is working to automate a testing routine on a piece of software. On doing inputs, they are making use of

type(Key.TAB)

to move from one box to the next in sequence. However, it's not doing anything.

Base OS: Windows 10
Application: access via Citrix receiver (sorry, can't be more specific)

Put another way:

Given the code:
type('abc')
type(Key.TAB)
type('DEF')

This should result in the first two fields coming in as:

Field 1 | Field 2
abc |DEF

Instead, we're getting:

Field 1 | Field 2
abcDEF | <blank>

When they attempt to perform the task manually (not via Sikuli script), the Tab key on their keyboard works to move from field to field.

Key.LEFT and Key.RIGHT have similar issues (when operated by hand, moves from field to field; when automated does nothing)

Question: does <type(Key.TAB)> send a different code to Windows than what a standard 101/102 Key US keyboard sends?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2021-03-09
Last query:
2021-03-09
Last reply:
2021-03-09
RaiMan (raimund-hocke) said : #1

Which Java?
Which SikuliX?

David Eells (spaceman2901) said : #2

SikuliX 2.0.4 on Java 8.0_281

Best RaiMan (raimund-hocke) said : #3

On Windows the keyboard layout is automatically evaluated.
But this might somehow clash with your Citrix environment (... but I have no experiences).

You might try with
Settings.AutoDetectKeyboardLayout = False

But then you have to take care, that you work with the standard US keyboard layout.

David Eells (spaceman2901) said : #4

That fixed the problem. I guess the Citrix keyboard virtualization didn't like the auto-detected layout. Thank you!

David Eells (spaceman2901) said : #5

Thanks RaiMan, that solved my question.