sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #32489
Re: [Question #266528]: app.focus() not working after window title change (Windows 8.1)?
Question #266528 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/266528
RaiMan proposed the following answer:
--- subsequent app.focus() doesn't work
The next thing I will fix.
--- this is my test script:
import time
is10 = False
start = time.time()
try:
import org.sikuli.script.SikulixForJython
except:
is10 = True
import org.sikuli.basics.SikuliXforJython
from sikuli import *
lap = time.time(); print "startup:", lap - start; start = lap
bc = App(r'"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"')
if is10: bc.open()
lap = time.time(); print "App():", lap - start; start = lap
wait(1); click(); wait(1) # comment
start = time.time()
bc.focus()
lap = time.time(); print "App.focus:", lap - start; start = lap
wait(1); click(); wait(1) # comment
start = time.time()
bc.focus()
lap = time.time(); print "App.focus:", lap - start; start = lap
wait(2)
#bc.close()
App.focus("Google Chrome")
wait(2)
type(Key.F4, Key.ALT)
comment:
I am working on a 2 monitor system
Chrome opens on the 2nd monitor.
I use the click to the app in center of 1st monitor to "un-focus" chrome.
This might have to be adapted to your situation.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.