Forum Discussion

sergeys's avatar
sergeys
Contributor
8 years ago

TestComplete crashes if to Pause runner within OnLogError event, and then stopping it manually

Hi there,

 

Is it known issue?

 

I have event that stops excecution on some kind of errors, and I have project variable called 'PauseOnError'. So the first check within event - is PauseOnError true? - then it will either pause runner or probably stop it.

function GeneralEvents_OnLogError(Sender, LogParams) {
if (Project.Variables.PauseOnError == true) {
Runner.Pause();
} else 
if ((LogParams.Str.indexOf("process crashed") >= 0) ||
(LogParams.Str.indexOf("exception") >= 0) ||
(LogParams.Str.indexOf("login failed") >= 0) ||
(LogParams.Str.indexOf("button is disabled") >= 0) ||
(LogParams.Str.indexOf("is not found") >= 0) ||
(LogParams.Str.indexOf("The object does not exist. See Additional Information for details.") >= 0) ||
(LogParams.Str.indexOf("The database version does not match the software version. Please contact your system administrator") >= 0))
Runner.Stop();
}

 

 

 

So, I'm constantly getting TestComplete crash when having runner paused and then clicking 'Stop' manually from TC toolbar.

 

 

 

Thanks,

Sergey

5 Replies

  • Hi Sergeys

     

    Have you tried just the Runner.Pause and if not Runner.stop without the exceptions, login failed etc. prior to stopping the test? Want to eliminate other aspects of the function

     

    Regards

    Damien Walsh

     

    Technical Sales Engineer

    • sergeys's avatar
      sergeys
      Contributor

      Checking the content of error message is implemented by design - anyway I don't think that simplifying function to be just if (...) Runner.Pause else Runner.Stop will solve the problem, as after pause work - it jumps to the last '}' line of function. And afterwards - when clicking on Stop manually - it crashes.

       

      I've just implemented workaround - by replacing 'Runner.Pause' by 'Log.Message(...)' and setting breakpoint for it - thus no crashes and it works the same way as I expected.

      • sergeys's avatar
        sergeys
        Contributor

        Actually it is failing as well with exception, so the question is still actual...