Open an App linux

Asked by Varun Umesh on 2021-01-11

Hi all,

I am trying to open a custom software application on linux via Sikuli.
But traditional way App.open("some app") and also with the path to the app.
Its giving the following error:

[error] findWindow:
[error] error in command [wmctrl, -lpGx]
[errout] X Error of failed request: BadWindow (invalid Window parameter)
  Major opcode of failed request: 20 (X_GetProperty)
  Resource id in failed request: 0x2e00169
  Serial number of failed request: 15
  Current serial number in output stream: 15

But when I open the app manually Sikuli performs as expected.

OS : Fedora 33
Sikuli: 2.0.4

Thanks in advance.

Regards,
Varun Umesh

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2021-01-12
Last reply:
2021-01-12
RaiMan (raimund-hocke) said : #1

please paste the code snippet you are using

Varun Umesh (varunumesh) said : #2

myApp = App.("/home/tm/Documents/mvts/MCVTS/bin/MCVTS")
myApp.open()
myApp.focus()

I have tried with both .exe and .app extentions.
App type : executable (application/x-executable)

I have also tried with these syntax:

myApp = App("/myapps/someApp.app")
myApp = App(r"c:\myapps\someApp.exe")
myApp = App(r'"c:\folder with spaces\someApp.exe"')

Varun Umesh (varunumesh) said : #3

myApp = App("/home/tm/Documents/mvts/MCVTS/bin/MCVTS")
myApp.open()
myApp.focus()

RaiMan (raimund-hocke) said : #4

When someApp.open() is used, SikuliX internally waits until the program is started and then tries to identify the main program window.

In your case the program start as such seems to work, but the subsequent findWindow has problems using the command
wmctrl -lpGx
which should produce a list of all open windows.

So you might track the problem down, by opening the program manually and then in a terminal issue the command wmctrl -lpGx, to see what happens.

If this does not reveal a solution, you have to start the program manually outside the script or use run(someCommand) in the script.
Be aware: someCommand must not wait for anything, but issue something to start the app and then immediately come back.

Can you help with this problem?

Provide an answer of your own, or ask Varun Umesh for more information if necessary.

To post a message you must log in.