UIA objects are identified very slowly and Test complete really freezes for a long time
Hi,
I have test complete Instaled on a macine which is relatively very fast. (8GB Ram,Win7 64 Bit with 3.40 GHZ i7 Processor.So System wise its fine I guess. I am testing a windows applicaion developed partly using VB and some other .NET technology(which I am not quiet sure of). I have a screen whcih I think is using crystal repots to show records as a report. When I see the object in object explorer its full name is :
Sys.Process('BrandAn').WinFormsObject('frmReport').WinFormsObject('rptViewer').WinFormsObject('paramsSplitContainer').WinFormsObject('tableLayoutPanel1').WinFormsObject('panel2').WinFormsObject('dmSplitContainer').WinFormsObject('tableLayoutPanel1').WinFormsObject('panel2').WinFormsObject('winRSviewer').WinFormsObject('ReportPanel', '').WinFormsObject('RenderingPanel', '')
I was unable to access its properties ,so I refered to the formus and added this under
Tools->Current Project Properties -> Open Applications -> UI Automation
I added this WindowsForms*.Window* which now shows more children under the control I mentioned above and I can also access them.
But the problem is, they are identified as UIA controls which I unedrstand why.But they are really very slow to be identified by Test complete Object browser. When my report has close to 30 records all is good,but when I have close to 20k records thats when TC freezes for more than 30 mins for identifying any of the properties of these UIA objects .For example I am exceucing this code :
function CheckBAReportGenerated(IsLogError:boolean=true):boolean; var rptBodyObj,pr,obj,wndMsgObj,toolBarObj:OleVariant; i,count:integer; begin try try pr := Reports_BA_GetReportParentObj; if not pr.exists then exit; //check to see if the No Data Window has appeared,if yes then no report has been generated if CheckPopWindowMessage('Brand Analysis','No Data','OK','There are no matching records to report on.',3000, true, false) then begin Log.Message('The No Data Dialog has appeared with the message : "There are no matching records to report on." '); result := false; exit; end; {cheek to see if the report has some data in it} //click on the search button on the report to make sure some of the UIA objects on the report gets invoked. toolBarObj := Reports_BA_GetReportToolBarObj; toolBarObj.ClickItem(19); rptBodyObj := Reports_BA_GetReportBodyObj; if not rptBodyObj.exists then exit; obj := GetWindowsObject( rptBodyObj,['Name'],['UIAObject(''Tablix'')'],10000,true,0); if not obj.Exists then exit; if obj.ChildCount > 0 then //has data begin result := true; end; except Log.Error('Exception in CheckBAReportGenerated',exceptionmessage); end; finally if IsLogError then begin if result then Log.Message('Brand Analysis Report has been generated successfully',nil,300,nil,Sys.Desktop.Picture()) else Log.Error('Brand Analysis Report has not been generated',nil,300,nil,Sys.Desktop.Picture()); end; end; end;
As mentioned it all works fine until .
obj := GetWindowsObject( rptBodyObj,['Name'],['UIAObject(''Tablix'')'],10000,true,0); if not obj.Exists then exit;
But when there are more records on the screen like on Report_2 attachment TC freezes at this point
if obj.ChildCount > 0 then
begin
..............
..............
end