← Back to team overview

sikuli-driver team mailing list archive

[Question #665352]: App.open only works once then fails

 

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

Sikuli X 1.1.2 March Nightly (same effect with 1.1.1 Stable)
Windows 10 Creators Fall update with all latest patches installed


i  have my automation script that has always worked. even after updating to Windows 10 Creators update it still worked but out of now here now it no longer works the same way.

at the top of my main Unit i define my App instance:

timeslip = App(os.path.join(r"C:\tssmoketest", Settings.Version, "timeslip.exe"))

then later I call it:

timeslip.open()


it works the first time which i close either with:

timeslip.close() or another method I created called TSAppClose() which is just:

def TSAppClose():
    type(Key.F4, KeyModifier.ALT)
    wait(IMG_timeslips_exit_dialog_popup, 30)
    type('y', KeyModifier.ALT)
    waitVanish(IMG_timeslips_exit_dialog_popup)
    if exists(IMG_Win10BackupCurrentDBonExit):
        type('n', KeyModifier.ALT)
        waitVanish(IMG_Win10BackupCurrentDBonExit)

either one works fine. timeslip.close() kills the process and TSAppClose() gracerfully closes my app correctly with the UI which cleans up any threads that are running which killing the main process does not.



back to my issue.

if i do this:
timeslip = App(os.path.join(r"C:\tssmoketest", Settings.Version, "timeslip.exe"))
timeslip.open() 
timeslip.close()
timeslip.open() 

i get:

[error] App.open failed: C:\tssmoketest\2019\timeslip.exe not found

the only way i can get around it is by doing this:

timeslip = App(os.path.join(r"C:\tssmoketest", Settings.Version, "timeslip.exe"))
timeslip.open()
timeslip.close()

timeslip = App(os.path.join(r"C:\tssmoketest", Settings.Version, "timeslip.exe"))
timeslip.open()
timeslip.close()



any idea what i have to define my app instance every time I call it instead of just being able to define it once and call it multiple times?




-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.