Forum Discussion

Oferv's avatar
Oferv
Super Contributor
13 years ago

TC is unable to load the log file

Hi,

i'm running a script that is run for many hours and in the end/middle of the run TC popup an error message says TC is unable to load the log file.

i need the log file for analyse ASAP!!!!!!

can someone give me a hand here plssss?

attached is the error message

thanks

5 Replies

  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hi Ofer,



    The log file that is generated during a long-running test could consume too much memory for storing messages and cause such errors. To make the log smaller, you need to disable event logging with the Log.LockEvents method.



    Regards, Artem.
  • Oferv's avatar
    Oferv
    Super Contributor
    Hi Artem,



    I don't get it can't i log anything i want in the log file??it's weird that such a small log file is unable to be generated.

    log file should contain any action perform during the test and if i'll lock it from reporting then what';s the use of the log file?



    Thanks
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    It has nothing to do with TC functionality, it has to do with physical limitations.  Your machine may, simply, not have enough memory available to be able to keep the log in memory if it gets too large.



    Artem's suggestion is the best, really.  If your Log file is too large, you can do two things.  First, prioritize your log and determine what messages, events, warnings, errors, etc., can be skipped and which ones are vital to your test results.  You may be logging a lot of messages that are just "noise" and add no value to determining if a test passed or failed.



    Do you really need to know, during a regular script run, whether each button was clicked, each key pressed, each window opened, etc?  Or do you just need to know whether the test passed or failed and, if it failed, why?  logging those other actions are good when debugging automation code, but for a regular run that you're just using to validate/verify/check a feature, they are not, strictly speaking, necessary.



    Secondly, consider breaking your project up into multiple projects so that each project will, effectively, have a smaller log.



    The only other thing, which is more expensive, is to expand the hardware capabilities of your environment. 
  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Thanks Robert.



    One thing I'd like to emphasize is that the issue is not with 2-kilobyte Description.tcLog, but with the entire test log. That isn't that small.

    Each message posted to the log is supplemented with some overhead information. For instance, the messages of the Event type are accompanied with screenshots that illustrate the performed action. TestComplete stores these data in RAM unless the test run is finished. In most cases, this is ok.



    However, during long-running tests, the amount of performed user actions (and the respective Event-messages) goes far beyond thousands. As a result, the test log could exceed the available memory, which lead to the errors.



    That is why, for long-running tests and testing large applications, we recommend disabling event-logging. At that, messages of other types (messages, errors, warnings and so forth) are still posted to the log. Moreover, TestComplete still keeps the data about several latest events (20 by default) and posts them in case of an error or warning.