Forum Discussion

Andy_Omelyanenk's avatar
Andy_Omelyanenk
New Contributor
10 years ago

How to set the overall test status

What I'm really after is to know how can I clear the current error (as result of failed UI control click for example)? For example in QTP I could easily check the last error, clear the error, take neccessary action and then move on and the test status would be success.

In Test Complete there's this nice Try/Catch functionality which for some reason doesn't catch failed UI control interactions. I don't want my whole test  to fail just because there was 1 failed UI interaction

4 Replies

  • Ok, so far I've found out that by disabling Log.Enabled  (Log.Enabled := false;)

    I effectively disable error logging at all - that is no error will be reported and thus my test will not fail because of that 1 failed UI interaction (I can add some verifications points and fail the test with them).

    But is that it? I mean common, even QTP does better than that with its mediocre VBscript capabilities - but QTP gives me more control over error handling even though QTP has no Try/Catch/Finally constructs yet at least QTP lets me obtain the last error that occurred and clear it if necessary rather than fail the whole test.

    Why then Test Complete which seems way more advanced than QTP doesn't do it?
  • jose_pita's avatar
    jose_pita
    Super Contributor
    Think object oriented:



    1. use find to see if object exists


    2. if it does exist, click it


    3. else move on to the next step


    This way you don't have to worry about failed steps, you control you logs. If you need, in case the object does not exist, you can log a warning or a simple message.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi,



    Check TestComplete's help for the OnLogError (and other test events).