RaiMan / SikuliX-2014

SikuliX version 1.1.2 (until February 2018)
http://sikulix.com
805 stars 235 forks source link

App.open() not finding an already open window #286

Open alkhimey opened 6 years ago

alkhimey commented 6 years ago

The relevant documentaion:

At time of instance creation the process list is scanned for the name of the executable using the given text. If this is found, the app instance is initialized with the respective information (PID, executable, window title of main/frontmost window).

I tried this:

ff = App("firefox")
ff.open()
print ff
ff2 = App("firefox")
ff2.open()
print ff2

Results in firefox being open twice

[log] App.open [6712:firefox]
[6712:firefox ()] firefox
[log] App.open [6716:firefox]
[6716:firefox ()] firefox

OS is Ubuntu 17.4 and installed Sikulix 1.1.0 from apt.

alkhimey commented 6 years ago

In the example, I forgot to wait after opening the first instance. Nevertheless the issue is still valid.

alkhimey commented 6 years ago

@RaiMan

I want to try to solve this. I looked in the code and it seems like a very localized fix in LinuxUtil.java file (as well as the other function like isRunning #276)

I am not very familiar with java build systems though. Is there a better way developing rather than building with maven a package and installing and opening the IDE? I am sure there is more developer friendly way I have missed here.