Saturday, February 25, 2012

How to find the Memory usage and Processor usage using QTP

QTP provides the object called "SystemMonitor" which can be used to get Memory and Processor usage.

'To find the Memory usage of an application, use below:
SystemMonitor.GetValue("Application name without extension", "counter name")
Ex: msgbox SystemMonitor.GetValue("QTPro","Memory Usage (in MB)")

'To find the Processor usage of an application, use below:
Ex: msgbox SystemMonitor.GetValue("javaw","% Processor Time")

No comments: