← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #172559]: logging result of assert

 

Question #172559 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/172559

ironmantis7x posted a new comment:
I am trying your recommendation from comment#1 and my test is not catching the assertions and exiting.  what am I doing wrong??
here is my code:

------------------------------------------------------------
## Starting on Home screen of tablet, find & click TWC logo
find("1344004317402.png")
if not exists("1344004317402.png"):
    print"[error]: Can't Start Application"
    exit(1)
else:
    click("1344004329798.png")
## need to wait for splash screen to disappear, if it comes up
wait("UserName-3.png", 40)
if not exists("UserName-3.png"):
    print"[error]: Can't Start Application";
    exit(1)
if exists ("UserNamesyst-3.png", 30):
    click("1344456739810.png")
    type("OVPtest3")
##    wait("1344004995040.png", 40)
    if not exists("1344004995040.png"):
        print "[error]: Failed Login";
        exit(1)
    else:
        click("1344004995040.png")
else:
    click("UserName-1.png")
    type("system3")
    wait("Next-1.png",40)
    if not exists ("Next-1.png"):
        print "[error]: Failed Login";
        exit(1)
    else:
        click("Next-1.png")
        type("OVPtest3")
wait("1344004995040.png", 20)
if not exists("1344004995040.png"):
    print"[error]: Failed Login";
    exit(1)
else:
    click("1344004995040.png")
wait("1344005165442.png", 40)
if not exists ("1344005165442.png"):
    print"[error] Failed Login";
    exit(1)
else:
    click("1344005165442.png")
    wait("1344005165442-1.png", 40)
    click("1344005165442-1.png")
wait("LiveTV.png", 30)
click("LiveTV.png")
waitVanish("LiveTV.png", 45)
##click to bring up channel menu
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
wait("1344010149483.png", 30)
if not exists("1344010149483.png"):
    print "[error] Menu item not found";
    exit(1)
## Verify icons work on menu
wait("1344030880187.png", 30)
if not exists("1344030880187.png"):
    print "[error] Menu item not found"
    exit(1)
else:
    click("1344030880187.png")
    waitVanish("1344030880187.png", 45)
    mouseDown(Button.LEFT)
    mouseUp(Button.LEFT)
## scroll side channel menu to find "Comedy Central"
if exists ("1344021746236.png"):
    click("1344021746236.png")
    waitVanish("1344021746236.png", 45)
    mouseDown(Button.LEFT)
    mouseUp(Button.LEFT)
else:
    dragDrop("n1.png", "1344262100346.png")
    wait("1344262317049.png", 45)
    if not exists ("1344262317049.png"):
        print "[error] Menu image not found"
        exit(1)
    dragDrop("1344262317049.png", "n1.png")
    wait("1344021746236.png", 45)
    click("1344021746236.png")
    waitVanish("1344021746236.png", 45)
    mouseDown(Button.LEFT)
    mouseUp(Button.LEFT)
## Signing out of application
wait("1.png", 40)
if not exists("1.png"):
    print "[error] Timeout error on settings"
    exit(1)
else:
    click("1.png")
wait("SignOut.png", 40)
if not exists("SignOut.png"):
    print "[error] Signout error"
    exit(1)
else:
    click("SignOut.png")
wait("1344005266189.png", 60)
if not exists("1344005266189.png"):
    print"[error] Signout error"
    exit(1)
else:
    click("1344005266189.png")
click("1344005349223.png")
print"[success]"
---------------------------------------------

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