If a test case fails the remaining testcase in the test suite aren't executed anymore

Asked by Edwin Veerkamp

I have created a 'Main.sikuli' importing a couple of test cases:

import Create_Account_IE
import Create_Account_FF
import Word

When one test case fails, then the remaining test cases aren't executed anymore.

Is there a way to solve this?

Thanks in advance for your help!

Question information

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

imported or not, if something in a script crashes and the corresponding exception is not catches, the script ends with an error at this line.

If you want to do something else in these cases, you have to wrap the respective parts in try:catch: blocks

It looks like, you are talking about the imported modules as "test cases".
If this is true:

try:
    import Create_Account_IE
    print "Create_Account_IE success"
catch:
    print "Create_Account_IE failed"

… and so on

Revision history for this message
Edwin Veerkamp (edwin-veerkamp) said :
#2

Hi RaiMan, thank you for your quick reply.

I've tried the solution you suggested, but that results in the following error:

[error] script [ Main ] stopped with error in line 4 at column 0
[error] SyntaxError ( "no viable alternative at input 'catch'", )

I have replaced catch by except, but then only the last test case 'Word' is executed

try:
    import Create_Account_IE
    print "Create_Account_IE success"
except:
    print "Create_Account_IE failed"

try:
    import Word
    print "Word success"
except:
    print "Word failed

Revision history for this message
Edwin Veerkamp (edwin-veerkamp) said :
#3

Hi RaiMan,

it's working fine now, I forgot to close Sikuli IDE after having run Main.sikuli.
Now all test cases are executed, even if after a test cases has failes.

Thanks a lot.