App class not working on Ubuntu 11.04 (QT issue?)

Asked by David Woods

Hi,

I'm attempting to use the App class to manipulate my applications on Ubuntu 11.04 x32 as follows:

foo = App("path to my app")
foo.open()
foo.focus()
... do stuff ...
foo.close()

The open works fine, but the focus throws an error (app not found) and the close throws no error but does print a log message.

I tested using a couple of the built in Ubuntu games and it works Ok, so there's something presumably about my apps. Unlike on Mac, there doesn't seem to be a spaces-in-strings issue.

My only thought is that the apps are written in Qt, though they appear to have normal title bars.

If anyone knows of a diagnostic test I could run to see what might be up, I would be most grateful.

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

besides the fact, that the class App is not fully implemented/functional on Linux systems, I think, that on linux (as on Windows), the app is seen from Sikuli as a window visible on the screen and is identified by the window title (or part of it).

So after you have opened an app using App.open(path-to-your-app), you have to switch to using window titles.

This works on windows:
App.open(path-to-your-app)
# wait somehow for the app to come up with a window
foo = App("part of window title")
foo.focus()
# do some stuff
foo.close()

Revision history for this message
David Woods (dwoods-x) said :
#2

I can report that even using part or all of the window title as suggested (or even just using the App() way of doing things) does not work for me on my apps, or in some cases on others. Looks like it really isn't implemented

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Sorry for misleading - Linux is not in my focus.

I made some tests on my Ubuntu 11 (running in VirtualBox on my Mac Lion):
App.open(), App.focus() and App.close() seem to work.
I had to use e.g. /usr/bin/gcalctool to start the Calculator.

It worked for me, to switch to a window using part of it's title (e.g. App("Character").focus() for app CharacterMap).

I did not succeed in using any App class's window functions.
So I guess, you have to forget it for now.

Can you help with this problem?

Provide an answer of your own, or ask David Woods for more information if necessary.

To post a message you must log in.