Forum Discussion
Sebastian,
Using events to get the performance information is a possible solution, but you need to know these events and find a way to handle them from TestComplete. TestComplete includes an Events project item that was designed to let users handle TestComplete events and events of ActiveX objects and COM servers. As far as I understood, you are testing a .NET application, and I'm not sure that it's possible to handle this application's events from within the test projects.
A possible alternative is to create handlers for the OnLogMessage, OnLogEvent, OnLogError and other similar TestComplete events. TestComplete triggers these events when it posts a message of the appropriate type to the log. If you run a functional test, there will be a lot of log messages. Within event handlers, you can query the performance counters and post their values as a part of the message's extended text (you can see it in the Additional Information section):
var PerfProcess;
...
// Sample OnLogEvent handler
function GeneralEvents_OnLogEvent(Sender, LogParams)
{
var s = LogParams.StrEx + "\n" +
"Memory: " + PerfProcess.WorkingSet + "\n" +
"Virtual: " + PerfProcess.VirtualBytes + "\n" +
"CPU Load: " + PerfProcess.PercentProcessorTime;
LogParams.StrEx = s;
}
You can find more information on event handling in the TestComplete help - http://smartbear.com/support/viewarticle/11118/. However, I think, this approach has a number of disadvantages: you will not get performance data at regular time intervals, and it will be difficult to analyze the data.
So, I'd suggest that you explore the approach using the logman utility. Why did you write the setup is complex? You do everything visually in a special dialog and have to define all the settings only once, then use them... If you cannot do something, you can ask about it on the Microsoft forums or ask for help here.
Anyhow, let us know how your experiments progress. :-)
Related Content
- 7 years ago
- 14 years ago
- 6 years ago
Recent Discussions
- 14 hours ago