App.focus stops working in SikuliX 1.1.1

Asked by Rayhaan Ahmed on 2017-04-18

I've been trying to upgrade to 1.1.1 for some of the new functionality with the user pop-ups, however, I noticed that App.focus calls are not working as expected. Instead, logs are showing they failed. Did the implementation change with the release? I currently have it focusing onto window titles; will I have to change how I'm doing it now?

Thanks for any help!

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
masuo (masuo-ohara) said : #1

Write your codes about the part of APP.focus (). I think that Answer is more easy to obtain.

RaiMan (raimund-hocke) said : #2

yes, the implementation was changed internally, but should work the same way (at least in most cases).

as masuo said: concrete examples would help.

Rayhaan Ahmed (rayhaan) said : #3

Here is a segment of affected code:
    def start(self):

        # open terminator
        App.focus("home@") <---- This line isn't creating issues, but I believe that is because already focuses the app

        # maximize terminal

        # set cleaning plan and robot
        type("byobu kill-server" + Key.ENTER)
        type("robot -c " + self.planName + Key.ENTER)
        AutomationLog("info", "Set cleaning plan")
        type("robot -r " + self.robot + Key.ENTER)
        AutomationLog("info", "Set robot")
        # start gazebo sim
        type("rosrun launch")
        ResultsLog("Simulation start time: " + currentTime())
        AutomationLog("info", "Gazebo simulation starting...")

        App.focus("home@") <---- This is where it is failing to focus to the terminal

The title of the window is 'home@unnamed (localip) - byobu'

Rayhaan Ahmed (rayhaan) said : #4

Sorry for the double post, but let me know if there is more info I can provide, thanks!

RaiMan (raimund-hocke) said : #5

try without the @

Another option is to use another part of the title, which is significant (need not be from the beginning, since the given text is checke with title.contains(giventext))

Can you help with this problem?

Provide an answer of your own, or ask Rayhaan Ahmed for more information if necessary.

To post a message you must log in.