How to use assert function

Asked by naveen

Below script is not working can u tell me the reason

thanks in advance

def setUp(self):
    doubleClick("umu.png")
    sleep(2)

    find("1350899125836.png")

    type("1350899134292.png", "guest")

    type("1350899151627.png", "guest")

    click("1350899165098.png")
    sleep(9)

def testA(self):
    click("DeviceManage-1.png")
    sleep(1)
    click("1351138732491.png")
    hover("NetworkIscAM.png")
    click("1351138763178.png")
    sleep(7)
    if exists("DeviceisON.png"):
        assert False
    else:assert true
def tearDown(self):
     click("1349774954074.png")
     click("1349869396520.png")

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
naveen
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

without detailed information about the problems you have, I have no chance to help you:
--- symptoms?
--- error messages?

Revision history for this message
naveen (mopuramnaveen) said :
#2

if exists("DeviceisON.png"):
        assert true
else:assert false

device is On button is available in my app so it wil display the true message right,but nothing displayed

Revision history for this message
RaiMan (raimund-hocke) said :
#3

depending on how you are running the test script (see faq 1804), you get a final summary about the results of the test cases.

While the tests are running, there is no specific message output alone with using assert.

If you want to have messages from the test cases, you have to implement them using print, logging or whatever.

Revision history for this message
naveen (mopuramnaveen) said :
#4

Thank u very much

thats solved my problem