← Back to team overview

sikuli-driver team mailing list archive

[Question #186552]: App focus not setting focus as expected

 

New question #186552 on Sikuli:
https://answers.launchpad.net/sikuli/+question/186552

I do the following, and yet sometimes the application (Visual Studio) does not start with focus and other times it does:

VSApp = App(VS_exe_path)
VSApp.open()
# wait for visual studio to start.  And it could take almost 90 seconds to start up on a slow machine
wait("VSStartPage.png", 90)
type("l", KEY_CTRL + KEY_ALT)
if not exists("VSexplorerWithFocus.png",5):
    # report a problem
else:
    # open a solution file


I can tell that the type() didn't go to Visual Studio because I watched the code run.  If I add a VSApp.focus() in between the "wait()" and "type()", Visual Studio loses focus if it has it, takes it if it doesn't (meaning no real change in behavior).

Any tips on how to prevent this?  I looked at the similar question posted about Firefox (184407), but I know there is only 1 Visual Studio application/window up and running (task manager only shows one devenv.exe process).  There may be other apps running, but I thought that by doing the "VSApp = App()" I ensured the VSApp.focus would only affect the one and only Visual Studio instance running.

Thanks,
Beth


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.