← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #240570]: Screenshot after test execution

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
-- 1. sorry my fault, but ...
stopped with error in line 6 at column 45
[error] SyntaxError ( "mismatched input ')' expecting NEWLINE", )

... tells us, that there is one wrong extra closing bracket at the end
;-)

def printScreen(filename):
    try:
        import shutil
        shutil.move(capture(SCREEN),filename)
    except:
        raise exception

-- 2: no filename given

    monthView()
    print("Test 11 - Passed")
    takeShot(filename)
    testOk = testOk +1;

except:

    print("Test 11 Failed")
    takeShot(filename)
    testNok = testNok +1;

filename is a variable, that should hold a valid filename (cannot see
wether and where you do that)

might be something like
filename = "Test11Passed.png"
and
filename = "Test11Failed.png"

this will save the shots to the current working directory.

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