| || |
Obtaining Handles and GDI Object counts with TCv5
I am trying to extract some performance information using testcomplete (TC). Currently TC will let me record the following values:
ProcessID.MemUsage 'Set Variable to record process Memory Usage
ProcessID.VMSize 'Set Variable to record process Virtual Memory Usage
ProcessID.CPUUsage 'Set Variable to record process CPU Usage
ProcessID.threadcount ' Set variable to Process Thread Count
However I am looking for a windows task manager style capability where I can extract Handles and GDI Objects using TC.
Does anyone have any ideas?
Re: Obtaining Handles and GDI Object counts with TCv5
You can get process information using WMI. The script below demonstrates how you can use this possibility (the "." computer name stands for the local computer).
Please note that WMI can be restricted on a remote computer, so you will be unable to get access to this computer. To find out how to set needed permissions for remote access, please refer to the following MSDN Library article:
<font class="small">Code:</font><hr /><pre>
Call PostProcessInfo(".", "Explorer")
Sub PostProcessInfo(computer, process)
Dim objWMIService, PerfProcess
Set objWMIService = GetObject("winmgmts:\\" & computer & "\root\cimv2")
Set PerfProcess = objWMIService.Get("Win32_PerfFormattedData_PerfPro c_Process.Name='" & process & "'")
Log.Message "Memory: " & PerfProcess.WorkingSet
Log.Message "Virtual: " & PerfProcess.VirtualBytes
Log.Message "CPU Load: " & PerfProcess.PercentProcessorTime
Additional information can be found here.