If I am within a GUI, interacting with said GUI using python 2.7 and sikulix API. If I click on something from within that GUI that opens another window in full screen, sikulix is currently having difficulty interacting with the newly opened window, it can still for some reason only see the old window even though it is underneath. I am able to make the newly opened window smaller, then take the original window and drag it down to a lower place in the screen, then re-maximize the new window and this will allow me to interact with the new window. --- Is there a better way to do this? (using CentOS)
Asked
Active
Viewed 946 times
2 Answers
3
If you already know the process exe name of the application you will be running form the gui, you can create an App reference linked to that app, such as:
yourApp = App("yourApp.exe")
From here, if you would like to click on something that belongs only to this window, you can create a region off of the new window which should be focused automatically after launching. This can be done like:
yourReg = Region(yourApp.focusedWindow())
From here, you can use this region to click items on the window such like:
yourReg.click(CancelButton.png)

Kristo Cule
- 147
- 15
0
Sikuli "sees" whatever there is on the screen so if there is a window, Sikuli can't ignore it. What probably happens in your case is that you progress too fast and Sikuli is still observing the previous screen. What you need to do is to wait sufficient time to ensure the new window has actually opened.

Eugene S
- 6,709
- 8
- 57
- 91
-
I have added a "safewait" command to wait until whatever I am looking for on said screen has come up and opened, but no matter how long I wait (times out after 20 seconds, 19 of which the window is open) I am still unable to interact with the new window. – Michael Smith Mar 06 '19 at 14:34
-
There is some issue with your screenshot then. Ensure there aren't even tiniest differences between the actual screen and your pattern. It must be similar on pixel level. – Eugene S Mar 06 '19 at 20:10
-
I have made sure the screenshot is fine, once I drag the initial window down and remaximize the new one the same screenshots work just fine. – Michael Smith Mar 06 '19 at 20:28