Forum Discussion

hannecroonen's avatar
hannecroonen
Contributor
3 years ago

Ignore Log error on .exe process crashed

Hi all,

 

I had a question about ignoring certain error logs.

I know you can do this without a problem for real error logs.

But for the ones where it says 'the ....exe process crashed' are impossible to ignore so it seems...

 

Does anyone know a way to leave this error out of the loggings?

It is some kind of refresh error on the program we are testing but impossible to solve this for our external party it seems.

It is not affecting anything else except for our automatic tests, so I would like to leave these error messages out of the logging file to get a decent result instead of every test always being failed.

 

Any help would be nice!

(I already tried the onlog events but the process crashes don't appear here.)

Thanks!

  • Have you tried this:

    Log.Enabled = false; // disable logs

    // here the step to open your app

    Log.Enabled = true; // enable the logs again

     

  • Kitt's avatar
    Kitt
    Regular Contributor

    To expand upon TCYKPB post and similar post (here), you can try this:

    function EventControls_OnLogError(Sender, LogParams)
    {
      // Check if the message includes the desired substring
      var locked = aqString.Find(LogParams.Str, "exe process crashed");
      if (locked != -1)
      {
        // If found, block the message
        LogParams.Locked = true;
      }
      else
      {
        // Else, post the message
        LogParams.Locked = false;
      }  
    }

     

    • hannecroonen's avatar
      hannecroonen
      Contributor

      Kitt TCYKPB 

      Hi guys,

       

      thanks for the suggestions!

      I did already try to put a LogParams.Locked line in the OnLogError function but it does not seem to enter this function when this error pops up.

      So I would not know where/when I could implement this that it does run through it.

       

      Seems that this error is excluded from the OnLogError function.

       

      • TCYKPB's avatar
        TCYKPB
        Contributor

        My suggestion was not to put it on the OnLogError, but on your test script, wherever it is that you run your application. Assuming you have a script named mytestcase.js, and your application is on the TestedApps list, it would look something like this:

         

         

        mytestcase.js
        // this would be javascript
        function myTest() {
            Log.Enabled = false;
            TestedApps.MyApp.Run();
            Log.Enabled = true;
        }

         

         

        If this doesn't work (which is highly possible given that many things in TestComplete do not work as we would expect), then I would suggest you to find an alternative way of opening your applications. Maybe instead of using TestedApps use a command line/cmd that will open your application, and see what happens there with TestComplete.

  • Hello everyone,

    I know it's been 2 years since the question was asked, but I have another problem that seems to be the explanation of yours (if you don't have your answer yet).

    I log all errors to send them to another tool by capturing the OnLogError() event, but when I get a "process ... crashed", it doesn't trigger the event even though it logs it as an error message in the logs!

    So that should explain your problem...

    My current problem is that I need to get this error event to log, so, how can I catch it?

    Thanks for your help.