Encountered exception using focus() in RedHat 6.4

Asked by Te Wang

Using SikuliX-1.0.1 on RedHat 6.4. Got an exception when calling focus():

term1 = App.open("gnome-terminal")
term1.focus()

Messages:
[log] openApp: gnome-terminal
[log] App.open gnome-terminal(31741)
[log] App.focus gnome-terminal(31741) #0
[error] script [ test ] stopped with error in line 14
[error] java.lang.ArrayIndexOutOfBoundsException ( java.lang.ArrayIndexOutOfBoundsException: 0 )

I tried the window version and worked fine. I'm new to Linux. I don't know if If installed Sikuli correctly, or there is some limitation in the LInux version. I installed opencv-2.4.10, tesseract-3.2.2, leptonica-1.68, and wmctrl-1.07. Appreciate if anyone can help.

John

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

on Linux the App features use wmctrl inside, to implement the features.

Might be that wmctrl in your special situation behaves odd, which leads to the exception (... and yes, the SikuliX code should handle such exceptions ;-)
so you might try with wmctrl from command line, wether it works and brings the app to the front.

a code snippet of your trial would be helpful.

If you are able to take the time:
give 1.1.0 a try (http://sikulix.com)
... and read the quick start tab before you do

Revision history for this message
Te Wang (tehanwan) said :
#2

Tried wmctrl from command line and didn't look right. Nothing happened when I tried out some wmctrl commands. I will try different version or re-intall. Thanks.
John

Can you help with this problem?

Provide an answer of your own, or ask Te Wang for more information if necessary.

To post a message you must log in.