Environment Details: Windows 7, 64 Bit, 8 GB RAM TestComplete 11.0 Project Details: Used NameMapping Approach Defined All object references in one script file as Global Variables. There are ...
Hope that it helps. I'm not sure how correct I am in this but I know that logging is a big memory hog for TC in previous versions. Let me know if this helps and, perhaps, this is a memory optimization thing that SmartBear can work on for future versions.
tristaanogre wrote: Hope that it helps. I'm not sure how correct I am in this but I know that logging is a big memory hog for TC in previous versions. Let me know if this helps and, perhaps, this is a memory optimization thing that SmartBear can work on for future versions.
I'm confused about something. Wrote the following function and passed 'true' and 100 and yet the logs shows more than 100 entries (see image). What am I missing?
function LockLog(val, count){
if(val == true)
Log.LockEvents(count);
else
Log.UnlockEvents();
}
Well there doesn't look to be an error or warning so there should be 0 events in your log. The 100 only says to hold onto the last 100 events and put them in the log if an error or warning occur. That's how it works for me at least.
Seems like something must be going wrong with your function or maybe the call to your function. I'm not very familiar with JScript so I can't say for sure, but maybe try adding a Log.Message() within the if statement to see if it's actually reaching the Log.LockEvents() call.
Well there doesn't look to be an error or warning so there should be 0 events in your log. The 100 only says to hold onto the last 100 events and put them in the log if an error or warning occur. That's how it works for me at least.
Seems like something must be going wrong with your function or maybe the call to your function. I'm not very familiar with JScript so I can't say for sure, but maybe try adding a Log.Message() within the if statement to see if it's actually reaching the Log.LockEvents() call.
I've set a break point in the code and I'm certain the function is getting called. I wasn't expecting to see any events logged.
Well there doesn't look to be an error or warning so there should be 0 events in your log. The 100 only says to hold onto the last 100 events and put them in the log if an error or warning occur. That's how it works for me at least.
Seems like something must be going wrong with your function or maybe the call to your function. I'm not very familiar with JScript so I can't say for sure, but maybe try adding a Log.Message() within the if statement to see if it's actually reaching the Log.LockEvents() call.
Turns out the clicks and property checks aren't events and calling LockEvents() isn't reducing the number of entries in the log. and isn't going to help with the memory problem. I'm going to try adding a step to close and re-open the browser in hopes of tcCrHost *32 proess will be freed up. Thanks for your help.
That's strange. Property checks, certainly, aren't events. But clicks and keyboard inputs are events.
Now, I'm running TestComplete 10.60 on my end but I can't imagine the code has changed that drastically. Here's what I did.
And the result is that without that Log.LockEvents call, the click event is showing up in my log.
With it, though, I no longer see the event
I did a bit more experimentation... and I reproduced your problem. In looking at the screenshot you showed, I see all your Keyword tests executing but I don't see where you are calling "LogLock" so I'm still not certain how you are calling that. But your log screenshot shows that each keyword test is a different test item in your project. The Log.LockEvents function only affects the current test item. So, if you have two test items and you call LogLock in the first test item but not in the second, the events will be locked for that first test item but not for any of the others.
So, here's what I did.
I took your function and put it in a script code unit. I then created an event handler for the OnStartTest event.
Also, the "100" is not the maximum number of events that will ever log, but it is the maximum number kept in buffer that will be dumped out to the log file upon the logging of a warning or error.
Quote from the userguide:
If an error or warning occurs, the buffered messages will be posted to the log to help you pin down the source of the error or warning. To disable the buffer, set Count to 0.
So, you would call "LockLog" at the very start of your test project to ensure it is on for the duration then, every time a warning or error is logged, the last 100 events leading up to it will be logged.