def wait(target, timeout=2):
    try:
        return sikuli_method('wait', target, float(timeout))
    except FindFailed, e:
        log.html_img("wait: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise e
def rightClick(target, modifiers=0):
    try:
        return sikuli_method('rightClick', target, modifiers)
    except FindFailed, e:
        log.html_img("rightClick: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise e
def verify(target, timeout=0):
    addFoundImage(getFilename(target))
    result = sikuli_method('exists', target, float(timeout))
    if not result:
        log.html_img("verify: Find failed", "images/"+getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Source Image", region=(sik_scrn.getX(), sik_scrn.getY(), sik_scrn.getW(), sik_scrn.getH()))
        raise VerifyException('Find failed for image ' + getFilename(target))
    return result
def wait(target, timeout=2):
    try:
        return sikuli_method('wait', target, float(timeout))
    except FindFailed, e:
        log.html_img("wait: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise e
def click(target, modifiers=0):
    try:
        return sikuli_method('click', target, modifiers)
    except FindFailed, e:
        log.html_img("click: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Screen",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise e
def verify(target, timeout=0):
    addFoundImage(getFilename(target))
    result = sikuli_method('exists', target, float(timeout))
    if not result:
        log.html_img("verify: Find failed", "images/" + getFilename(target))
        sik_scrn = SikuliScreen()
        log.screenshot(msg="Source Image",
                       region=(sik_scrn.getX(), sik_scrn.getY(),
                               sik_scrn.getW(), sik_scrn.getH()))
        raise VerifyException('Find failed for image ' + getFilename(target))
    return result
Exemple #7
0
        subprocess.Popen(['xdg-open', url])
    except OSError:
        print 'Opening the browser failed'


if __name__ == '__main__':
    #read username and password from stdin
    time.sleep(1)  #wait
    user = sys.stdin.readline()
    pwd = sys.stdin.readline()
    #Add path to where images shall be searched at
    ABS_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    addImagePath(ABS_PATH + "/images/dropbox")
    # Start browser
    start_browser("http://www.dropbox.com")
    screen = Screen()
    successful = configure_language()
    if not successful:
        popup(
            "Automatic registration at Dropbox failed for one of the following reasons.\n"
            +
            "Otherwise you can report an issue at https://github.com/joe42/CloudFusion/issues.\n"
            + "1. Firefox is not installed\n" +
            "2. You were already logged in to Dropbox\n" +
            "3. Your browser language settings are neither German nor English\n"
            + "4. Your browser is open in a different workspace\n", "Error")
    screen.click(dbRegistrationBtn)
    if screen.exists(firstNameInput, 2):
        screen.click(firstNameInput)
    screen.paste("John")
    screen.type(Key.TAB)
Exemple #8
0
from sikuli.Sikuli import Screen

scr = Screen()
scr.find(psc)
Exemple #9
0
        subprocess.Popen(['xdg-open', url])
    except OSError:
        print 'Opening the browser failed'


if __name__ == '__main__':
    #read username and password from stdin
    time.sleep(1)  #wait

    user = sys.stdin.readline()
    pwd = sys.stdin.readline()
    #Add path to where images shall be searched at
    CLOUDFUSION_PATH = os.path.dirname(
        os.path.dirname(os.path.abspath(__file__)))
    addImagePath(CLOUDFUSION_PATH + "/images/tonline")
    screen = Screen()
    # Start browser
    start_browser(
        "https://meinkonto.telekom-dienste.de/konto/registrierung/email/index.xhtml"
    )
    if screen.exists(salutationDropDown, 5):
        screen.click(salutationDropDown)
    if screen.exists(salutationDropDownM, 2):
        screen.click(salutationDropDownM)
    screen.type(Key.TAB)
    screen.paste("John")
    screen.type(Key.TAB)
    screen.paste("Smith")
    screen.type(Key.TAB)
    screen.paste(user)
    screen.type(Key.TAB)
from sikuli.Sikuli import Screen, Key
import time
scr = Screen()
time.sleep(3)
scr.type(Key.PAGE_DOWN)
Exemple #11
0
from sikuli.Sikuli import Screen

scr = Screen()
scr.doubleClick(psc)
    try:
        subprocess.Popen(['xdg-open', url])
    except OSError:
        print 'Opening the browser failed'

if __name__ == '__main__':
    #read username and password from stdin
    time.sleep(1) #wait 
    user = sys.stdin.readline()
    pwd = sys.stdin.readline()
    #Add path to where images shall be searched at
    ABS_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    addImagePath(ABS_PATH+"/images/dropbox")
    # Start browser
    start_browser("http://www.dropbox.com")
    screen = Screen()
    successful = configure_language()
    if not successful:
        popup("Automatic registration at Dropbox failed for one of the following reasons.\n"+
              "Otherwise you can report an issue at https://github.com/joe42/CloudFusion/issues.\n"+
              "1. Firefox is not installed\n"+
              "2. You were already logged in to Dropbox\n"+
              "3. Your browser language settings are neither German nor English\n"+
              "4. Your browser is open in a different workspace\n", 
              "Error")
    screen.click(dbRegistrationBtn)
    if screen.exists(firstNameInput,2):
        screen.click(firstNameInput)
    screen.paste("John")
    screen.type(Key.TAB)
    screen.paste("Smith")
def start_browser(url):
    try:
        subprocess.Popen(['xdg-open', url])
    except OSError:
        print 'Opening the browser failed'

if __name__ == '__main__':
    #read username and password from stdin
    time.sleep(1) #wait     

    user = sys.stdin.readline()
    pwd = sys.stdin.readline()
    #Add path to where images shall be searched at
    CLOUDFUSION_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    addImagePath(CLOUDFUSION_PATH+"/images/tonline")
    screen = Screen()
    # Start browser
    start_browser("https://meinkonto.telekom-dienste.de/konto/registrierung/email/index.xhtml")
    if screen.exists(salutationDropDown,5):
        screen.click(salutationDropDown)
    if screen.exists(salutationDropDownM,2):
        screen.click(salutationDropDownM)
    screen.type(Key.TAB)
    screen.paste("John")
    screen.type(Key.TAB)
    screen.paste("Smith")
    screen.type(Key.TAB)
    screen.paste(user)
    screen.type(Key.TAB)
    screen.paste(pwd)
    screen.type(Key.TAB)
from sikuli.Sikuli import Screen

scr = Screen()
scr.rightClick(psc)
from sikuli.Sikuli import Screen

scr = Screen()
scr.wait(psc, int(timeout))
scr.click(psc)
from sikuli.Sikuli import Screen

scr = Screen()
scr.wait(psc, int(timeout))
Exemple #17
0
from sikuli.Sikuli import Screen, KEY_CTRL, Key
scr = Screen()
scr.type(psc, "a", KEY_CTRL)
scr.type(Key.BACKSPACE)
scr.type(psc, content)