Activity log for bug #1800512

Date Who What changed Old value New value Message
2018-10-29 17:48:31 RaiMan bug added bug
2018-10-29 17:48:45 RaiMan sikuli: status New In Progress
2018-10-29 17:48:49 RaiMan sikuli: importance Undecided High
2018-10-29 17:48:53 RaiMan sikuli: assignee RaiMan (raimund-hocke)
2018-10-29 17:48:57 RaiMan sikuli: milestone 1.1.4
2018-10-30 14:57:49 RaiMan summary [1.1.4] Windows: App using window title only returns one app, should return all [1.1.4] Windows: App using window title only finds one app, should find all using focus(index)
2018-10-30 15:40:07 RaiMan description system: windows 10 situation: There are 5 applications with the same name running on the system. (With different PIDs) problem: In version 1.1.2, I can use App("some-text-of-window-title") to get all the windows of the 5 app. But in version 1.1.4, it failed. If I use APP("app-name-show-in-taskmanager"), it only returns the first app-object. So , I want to know how can I get All the windows that contains the same keyword in their window titles. My scripts are as follow(It runs well in 1.1.2, but failed to find any windows in 1.1.4): def getApp(sKeyWord): allClient = App("+%s" % sKeyWord) clientList = [] windowList = [] if not allClient: error_message("No client found with title %s" % sKeyWord) return clientList, 0, windowList iMainWindowIndex = getMainWindowIndex(sKeyWord) for i in range(10): oneClient = allClient.focus(i) #oneClient = allClient pid = oneClient.getPID() if pid <= 0: break info_message("========Client:%d pid=%s=============" % (i, pid)) w = oneClient.window(iMainWindowIndex) if not w.isValid(): continue clientList.append(oneClient) windowList.append(w) info_message("title = %s, client found:%d" % (sKeyWord, len(clientList))) return clientList, len(windowList), windowList getApp("Revision") result: in 1.1.2: [22:37:33][4299:4885] ========Client:0 pid=2932============= [22:37:33][4299:4885] ========Client:1 pid=1992============= [22:37:33][4316:4885] title = Revision, client found:2 in 1.1.4: [error] App.focus failed: not running: [-1:+Revision (???)] +Revision [22:38:45][4316:4885] title = Revision, client found:0 ------------------ the problem Beginning with 1.1.3 an App object is defined only by the executable. Hence the side effect of specifying (part of) the window title (Windows only) to define an App object is no longer available. And with that the possibility to focus an app by its window title is gone too. I will fix it, but it will work slightly different than in 1.1.2 ------------------ workaround using executable In case you have some instances of the same executable running, you can currently switch/focus using: app = App("executable") # instead of window title app.focus(0) # first instance found app1 = app.focus(1) app2 = app.focus(2) ... the returned app object's pid is <0 if not valid you might also check with appN.isValid() ------------------ workaround using window title import org.sikuli.natives.WinUtil as WinUtil App() # once at the beginning to load the native lib pid = WinUtil().switchApp(title, index) which brings the window to foreground (if exists) and returns the pid (0 if a window with the index is not found) In this case you will not have an app object for the window. --------------------------------------------------------------- system: windows 10 situation: There are 5 applications with the same name running on the system. (With different PIDs) problem: In version 1.1.2, I can use App("some-text-of-window-title") to get all the windows of the 5 app. But in version 1.1.4, it failed. If I use APP("app-name-show-in-taskmanager"), it only returns the first app-object. So , I want to know how can I get All the windows that contains the same keyword in their window titles. My scripts are as follow(It runs well in 1.1.2, but failed to find any windows in 1.1.4): def getApp(sKeyWord):     allClient = App("+%s" % sKeyWord)     clientList = []     windowList = []     if not allClient:         error_message("No client found with title %s" % sKeyWord)         return clientList, 0, windowList     iMainWindowIndex = getMainWindowIndex(sKeyWord)     for i in range(10):         oneClient = allClient.focus(i)         #oneClient = allClient         pid = oneClient.getPID()         if pid <= 0:             break         info_message("========Client:%d pid=%s=============" % (i, pid))         w = oneClient.window(iMainWindowIndex)         if not w.isValid():             continue         clientList.append(oneClient)         windowList.append(w)     info_message("title = %s, client found:%d" % (sKeyWord, len(clientList)))     return clientList, len(windowList), windowList getApp("Revision") result: in 1.1.2: [22:37:33][4299:4885] ========Client:0 pid=2932============= [22:37:33][4299:4885] ========Client:1 pid=1992============= [22:37:33][4316:4885] title = Revision, client found:2 in 1.1.4: [error] App.focus failed: not running: [-1:+Revision (???)] +Revision [22:38:45][4316:4885] title = Revision, client found:0
2018-10-31 16:25:56 RaiMan summary [1.1.4] Windows: App using window title only finds one app, should find all using focus(index) [1.1.4] Windows: App using window title only finds one app, should find all using focus(index) --- partly fixed 2018-10-31
2018-10-31 16:42:29 RaiMan sikuli: status In Progress Fix Committed
2018-10-31 16:42:31 RaiMan description ------------------ the problem Beginning with 1.1.3 an App object is defined only by the executable. Hence the side effect of specifying (part of) the window title (Windows only) to define an App object is no longer available. And with that the possibility to focus an app by its window title is gone too. I will fix it, but it will work slightly different than in 1.1.2 ------------------ workaround using executable In case you have some instances of the same executable running, you can currently switch/focus using: app = App("executable") # instead of window title app.focus(0) # first instance found app1 = app.focus(1) app2 = app.focus(2) ... the returned app object's pid is <0 if not valid you might also check with appN.isValid() ------------------ workaround using window title import org.sikuli.natives.WinUtil as WinUtil App() # once at the beginning to load the native lib pid = WinUtil().switchApp(title, index) which brings the window to foreground (if exists) and returns the pid (0 if a window with the index is not found) In this case you will not have an app object for the window. --------------------------------------------------------------- system: windows 10 situation: There are 5 applications with the same name running on the system. (With different PIDs) problem: In version 1.1.2, I can use App("some-text-of-window-title") to get all the windows of the 5 app. But in version 1.1.4, it failed. If I use APP("app-name-show-in-taskmanager"), it only returns the first app-object. So , I want to know how can I get All the windows that contains the same keyword in their window titles. My scripts are as follow(It runs well in 1.1.2, but failed to find any windows in 1.1.4): def getApp(sKeyWord):     allClient = App("+%s" % sKeyWord)     clientList = []     windowList = []     if not allClient:         error_message("No client found with title %s" % sKeyWord)         return clientList, 0, windowList     iMainWindowIndex = getMainWindowIndex(sKeyWord)     for i in range(10):         oneClient = allClient.focus(i)         #oneClient = allClient         pid = oneClient.getPID()         if pid <= 0:             break         info_message("========Client:%d pid=%s=============" % (i, pid))         w = oneClient.window(iMainWindowIndex)         if not w.isValid():             continue         clientList.append(oneClient)         windowList.append(w)     info_message("title = %s, client found:%d" % (sKeyWord, len(clientList)))     return clientList, len(windowList), windowList getApp("Revision") result: in 1.1.2: [22:37:33][4299:4885] ========Client:0 pid=2932============= [22:37:33][4299:4885] ========Client:1 pid=1992============= [22:37:33][4316:4885] title = Revision, client found:2 in 1.1.4: [error] App.focus failed: not running: [-1:+Revision (???)] +Revision [22:38:45][4316:4885] title = Revision, client found:0 --------------------- partly fixed --- see docs! - only on Windows, Linux still problematic - window titles only useable with app = App.focus(title [, index]) - a matching app is running or nothing happens - usage: app = App.focus(title) # first matching app or app = App.focus(title, 3) # 4th matching app - app.isValid() can be used to check for success - if app is valid, the window should have come to front ------------------ the problem Beginning with 1.1.3 an App object is defined only by the executable. Hence the side effect of specifying (part of) the window title (Windows only) to define an App object is no longer available. And with that the possibility to focus an app by its window title is gone too. I will fix it, but it will work slightly different than in 1.1.2 ------------------ workaround using executable In case you have some instances of the same executable running, you can currently switch/focus using: app = App("executable") # instead of window title app.focus(0) # first instance found app1 = app.focus(1) app2 = app.focus(2) ... the returned app object's pid is <0 if not valid you might also check with appN.isValid() ------------------ workaround using window title import org.sikuli.natives.WinUtil as WinUtil App() # once at the beginning to load the native lib pid = WinUtil().switchApp(title, index) which brings the window to foreground (if exists) and returns the pid (0 if a window with the index is not found) In this case you will not have an app object for the window. --------------------------------------------------------------- system: windows 10 situation: There are 5 applications with the same name running on the system. (With different PIDs) problem: In version 1.1.2, I can use App("some-text-of-window-title") to get all the windows of the 5 app. But in version 1.1.4, it failed. If I use APP("app-name-show-in-taskmanager"), it only returns the first app-object. So , I want to know how can I get All the windows that contains the same keyword in their window titles. My scripts are as follow(It runs well in 1.1.2, but failed to find any windows in 1.1.4): def getApp(sKeyWord):     allClient = App("+%s" % sKeyWord)     clientList = []     windowList = []     if not allClient:         error_message("No client found with title %s" % sKeyWord)         return clientList, 0, windowList     iMainWindowIndex = getMainWindowIndex(sKeyWord)     for i in range(10):         oneClient = allClient.focus(i)         #oneClient = allClient         pid = oneClient.getPID()         if pid <= 0:             break         info_message("========Client:%d pid=%s=============" % (i, pid))         w = oneClient.window(iMainWindowIndex)         if not w.isValid():             continue         clientList.append(oneClient)         windowList.append(w)     info_message("title = %s, client found:%d" % (sKeyWord, len(clientList)))     return clientList, len(windowList), windowList getApp("Revision") result: in 1.1.2: [22:37:33][4299:4885] ========Client:0 pid=2932============= [22:37:33][4299:4885] ========Client:1 pid=1992============= [22:37:33][4316:4885] title = Revision, client found:2 in 1.1.4: [error] App.focus failed: not running: [-1:+Revision (???)] +Revision [22:38:45][4316:4885] title = Revision, client found:0
2018-11-07 15:58:42 Rainer bug added subscriber Rainer
2019-11-07 14:48:58 RaiMan sikuli: status Fix Committed In Progress
2019-11-07 14:49:00 RaiMan sikuli: importance High Medium
2019-11-07 14:49:04 RaiMan sikuli: milestone 1.1.4 2.1.0