← Back to team overview

sikuli-driver team mailing list archive

[Question #213554]: sikuli does not work in windows taskscheduler when the system is locked

 

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

I have a sikuli script which basically opens a URL and saves it as .htm and I have scheduled to run every day using windows task scheduler using a .bat file.

The scheduler triggers the event but sikuli does not work if the system is locked.

Here is my .bat file:
@echo off
start C:\Save_DashBoard.skl

This is my sikuli script.

from sikuli.Sikuli import *
import datetime
now = datetime.datetime.now()
ReportDate = now.strftime("%Y-%m-%d")
WaitSeconds= 300
WaitMaxSeconds = 1000
ImagePath = "C:\\ImageRepository\\"
if not ImagePath in sys.path:
    sys.path.append(ImagePath)
setBundlePath(ImagePath)
PageLoadComplete = ImagePath+"PageLoad_Google.png"
AddressBar = ImagePath+"AddressBar.png"
AddressBar_1 = ImagePath+"AddressBar_1.png"
GraphLoad  = ImagePath+"GraphLoad.png"
DashBoardURL = "<URL>"
DashBoardLocale = "JP"
FilePath="C:\\Users\\<USER>\\Documents\\Dashboard_HTML\\"
try:
    keyUp()
    App.focus(r"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe")
    wait(2)
    type(" ",KEY_ALT)
    type("x")
    if exists(AddressBar):
        wait(AddressBar,WaitSeconds)
        wait(PageLoadComplete,WaitSeconds)
        wait(AddressBar,WaitSeconds)
        click(AddressBar)
    else:
        type("d",KEY_ALT)
    type(DashBoardURL)
    type(Key.ENTER)
    if exists(GraphLoad):
        wait(GraphLoad,WaitMaxSeconds)
        waitVanish(GraphLoad,WaitMaxSeconds)
    else:
        sleep(60)
    type("s",KEY_CTRL)
    type(FilePath + DashBoardLocale + "_Dashboard_" + ReportDate)
    type(Key.ENTER)
    sleep(60)
    type("y",KEY_ALT)
except:
    print "Error!!! Exception occured!!!"
finally:
    App.close("Mozilla Firefox")
    exit(1)

This is working if the system is not locked.

When the system is locked all the HOT keys does not work.

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