← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #674430]: Adding screenshot in test output for find failed error

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
The screenshot feature is only available for failed asserts.

hence you have to use 
assert false

instead of 
raise

BTW:
       try:

                assert(exists(element))
        except AssertionError:
                stack = traceback.extract_stack(limit = 2)
                print "Unable to assert image exists: " + Constants.BaselineFolder + str(element) + "\nBelow are exception details:\n" + str(sys.exc_info()[0]) + " -- line no. " + str(stack[0][1])
                raise

does not make sense, since the assertion exceptions are caught by
unitttest anyways

if !exists(element):
                stack = traceback.extract_stack(limit = 2)
                print "Unable to assert image exists: " + Constants.BaselineFolder + str(element) + "\nBelow are exception details:\n" + str(sys.exc_info()[0]) + " -- line no. " + str(stack[0][1])
                assert false

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.