Forum Discussion

krisss's avatar
krisss
Occasional Contributor
7 years ago

Is it possible to catch Testcomplete error (not script exception) ?

Hello !

I use the last version of testComplete 12.5 on windows 10

I would like to know if is it possible to catch a testComplete error. Not a script exception, but an error thrown by a testComplete function  of an object like grid.clickCell . (error like "column is not visible)

 

My main objective is to know that an error has happened but i don't want a log error in the testLog.

 

Grid.clickCell(1,colonne index) -->Error testComplete--> OnLogError-->Error in the log--> the test is failed in the test log  : but for me it's not critical, I don't want  my test written failed for that.

 

 

I tried to use the onLogError event to catch it: it works but it's too late, a line is writen in the log.

 

If i do a log.enabled=false before the clickCell, the event OnLogError is not fired.

I tried log.lockEvent but without success, a log error is added.

 

 

(i've got a good reason for that, i have to deal with a devExpress WPF grid bug)

 

Thanks for your help,

 

Regards,

Christophe

 

 

 

 

 

 

 

 

 

I

 

 

 

 

 

 

 

 

 

 

  • In your OnLogError event handler, add the following line

     

    LogParams.Locked = true;

    This will suppress the logging of the error itself.  All other errors will log, but this one will simply just not log anymore.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    In your OnLogError event handler, add the following line

     

    LogParams.Locked = true;

    This will suppress the logging of the error itself.  All other errors will log, but this one will simply just not log anymore.

  • krisss's avatar
    krisss
    Occasional Contributor

    Thanks, it works!

    I should have seen it in the help,I missed it sorry!

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        Do you not think it would be best to post a new post, instead of responding to a post that was answered 6 years ago!?