Can Sikuli continue after a failed assertion and log it?

Asked by Shawn Robertson

I have completed some test scripts that run as expected (many thanks to people on here including Raiman!)

in my scripts i have several assert lines that are similar to this:

assert exists(Pattern("SlipEntry.png").similar(0.95))

currently if they pass the script moves on and if it fails it just stops.

this was great while i was writing the script and going back and forth between running it, seeing if it failed and fixing it however after much thought this is not what i want in the end.

In the end i would love for the script to run say over night for example and if it fails an assert then log the fail and move on and at the end of the script, output all failed and passed asserts to a log file for me to view in the morning.

is this possible?

BTW have a happy holiday to everyone!

Shawn

Question information

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

this is exactly what Python unittest does (and all the other testing frameworks like RobotFramework, ...):
catch the asserts for you and turn them into a reporting, while one of your tests runs after the other.

as a start: faq 1804

Can you help with this problem?

Provide an answer of your own, or ask Shawn Robertson for more information if necessary.

To post a message you must log in.