Picture capture time increases during test
I have to resort to text recognition to identify codejock tabs. To find the active tab I then need to test that the background colour of the text object is blue. The picture capture takes about 1 second at the start of the test run but grows exponentially. After I have opened and identified about 50 forms it can take 5 seconds just to capture the picture object. I have seen it take 19 seconds on several runs. This can add up to 15 minutes to each test run.
Any ideas why capturing a picture object may take an increasing amount of time? Do I need to flush something periodically?
VBScript:
function isFormCurrent(form)
'Tests if the form named has the correct background colour that indicates it is the current form
isFormCurrent = false
if len(form)>0 then
if project.Variables.OpenForms.exists then
sys.refresh
set textObj = project.Variables.OpenForms.waitchild("TextObject(""" & form & "*", 0)
if textObj.exists then
'Test if the form is current by inspecting the top left pixel of the tab label against the current form BG colour
set TabPic = textObj.picture 'THIS IS THE COMMAND THAT TAKES INCREASING TIME TO EXECUTE
pixColour = TabPic.Pixels(0,0)
if pixColour = CurrentFormBGColour then
isFormCurrent = true
end if
end if
end if
end if
end function
I used the above code and made it verbose so that I could surround each line with the following to identify which step was causing the increasing delay each time I opened a new form.
startTime = aqDateTime.Time()
...
log.error("DEBUG: isFormCurrent took " & aqConvert.TimeIntervalToStr(aqDateTime.TimeInterval(startTime, aqDateTime.Time()) ) & " to execute step" )
Thanks,
Do you open one window form ontop of another?
if you do that manually does application working memory increase?
what if programmetical close entire application and open again?