[Sikuli-driver] [Question #270599]: While testing a GUI if the script does not see an image it wait fail and the script stops.

2015-08-20 Thread Jason
New question #270599 on Sikuli:
https://answers.launchpad.net/sikuli/+question/270599

I am testing a GUI application and I want to log failures (images missing), but 
want the script to complete without stopping in the middle.

I am using the assert exists(#link_to_image#), 5) When the script detects a 
missing image it will stop in the middle and log the error in the message 
field. I do not want to SKIP , the missing image in a Not Found situation 
and I do not want to ABORT or RETRY either. The purpose of my testing is to 
detect issues with the GUI not skip over them.

Is there another way to report the error at the end once the script is finished 
without stopping in the middle?

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #270599]: While testing a GUI if the script does not see an image it wait fail and the script stops.

2015-08-20 Thread RaiMan
Question #270599 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/270599

Status: Open = Answered

RaiMan proposed the following answer:
for this one usually use something like unittest and pack each image test in an 
extra testcase.
each testcase then ends with an assert and the assert results (pass/fail) are 
reported in the test report.

with your usage of assert it simply stops if an assertion fails with an
assertion exception (which is the intention of this feature).

But assert simply is nothing else than a shortcut for something like
this (meta code):

if  not exists(#link_to_image#), 5):
throw an assertion exception
else:
do nothing and proceed

So if you do not want to use unittest (see faq 1804), then you have to
replace the asserts by something like this:

if  not exists(#link_to_image#), 5):
print NotFound: , #link_to_image#

so in case of not found you get the message and in any case the script
continues.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp