Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting Diagnostic Data from Task Manager
#1
I'm using quick macros to do some GUI testing for an application my company builds. Our GUI seems to crash due to a memory leak of some sort. After switching between many screens within the GUI, the number of GDI objects shoots through the roof, and the GUI bogs down and crashes.

My question is, is it possible to use quick macros to harvest the diagnostic information from the task manager? I'm mostly interested in the memory usage and GDI objects of the process specific to our GUI. Attached is a screenshot indicating the information I'd like to log during my tests.

Thanks in advance for the help Big Grin

   
#2
Macro
Code:
Copy      Help
Acc a=acc("firefox.exe" "LISTITEM" win("Windows Task Manager" "#32770") "SysListView32" "" 0x1001)
str s=a.Description
out s
ARRAY(str) b
tok s b -1 ";:"
int i
for i 0 b.len
,b[i].trim
,out b[i]
,

mem usage probably will be in b[5],
gdi objects in b[7]
#3
Code:
Copy      Help
;;Declare Variables
int i
int c = 500;;how many times?
int waitBetweenCommands = 0

File f.Open("$my qm$\BabyControlCenterTesting4.csv" "a")
fprintf f "BEGINNING NEW MACRO[]"
fprintf f "iteration#,AllBabies->BC,BC->Program,Program->Reports,Reports->AllBabies,totaltime[]"

long beginTime
long time1
long time2
long time3
long endTime

long alltobc
long bctoprogram
long programtoreports
long reportstoall
long iterationDuration

for i 0 c
,fprintf f "%i," i
,beginTime=perf
,
,;;select all babies
,wait 0 S "babyXAll.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;look at birth certificates
,wait 0 S "babyBirthCertificates.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands    
,
,;;go back
,wait 0 S "babyBack.bmp" 0 0 0x1
,;;Log time it took to get to birth certificate screen
,time1=perf
,alltobc = time1-beginTime
,fprintf f "%i," alltobc
,lef
,wait waitBetweenCommands
,,
,;;unselect all babies
,wait 0 S "babyXAll2.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;select the (probably)first baby
,wait 0 S "babyCheckMark.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;program baby
,wait 0 S "babyProgram.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;done button
,wait 0 S "babyDone.bmp" 0 0 0x1
,;;Log time it took to get to birth certificate screen
,time2=perf
,bctoprogram = time2-time1
,fprintf f "%i," bctoprogram
,lef
,wait waitBetweenCommands

,;;view baby reports
,wait 0 S "babyReports.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;yes we want to lose baby information
,wait 0 S "babyYesButton.bmp" 0 0 0x1
,;;Log time it took to get to birth certificate screen
,time3=perf
,programtoreports = time3-time2
,fprintf f "%i," programtoreports
,lef
,wait waitBetweenCommands
,
,;;go to All Babies Screen
,wait 0 S "babyAll.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;unselect all babies
,wait 0 S "babyXAll2.bmp" 0 0 0x1
,lef
,wait waitBetweenCommands
,
,;;move pointer to top corner of screen, so we can
,;;select all the babies again in the next iteration.
,mou 1 1
,
,;;log the time, print to console.
,endTime=perf
,reportstoall = endTime-time3
,iterationDuration = endTime-beginTime
,out "iteration:%i time(microseconds): %i" i iterationDuration
,fprintf f "%i," reportstoall
,fprintf f "%i[]" iterationDuration
,
,

,
,
,




This is my macro. You can see that I'm logging the time it takes me to get between the various screens in the software, but yeah that diagnostic stuff would be more useful. I'll give that a try. Thanks.
#4
Many Thanks, mate. It seems to be working.


Forum Jump:


Users browsing this thread: 1 Guest(s)