Forum Discussion

Bharadwaj's avatar
Bharadwaj
Contributor
9 years ago

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

 

8 Replies

  • Bharadwaj, I too am wondering if you ever found out anything on this.  I have a similar scenario and was curious as to what you found.   Thanks

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      The reason for the slow performance is most likely because, with the addition to the UI Automation in his project, he is basically telling TestComplete to access ALL objects of matching classes using that methodology, not just the ones he needs for his report.  The better solution is to take his time and map each component type he needs and ONLY those he needs with the UI Automation plug in.

      Of course, thjis original post is 5 years old... that's several versions of TestComplete ago... so, it's entirely likely that the slowness has been resolved.

      If you are having a specific problem with TC 12 with this feature, it might be best to address that separately.

      • bknutson's avatar
        bknutson
        Contributor

        Thanks for the reply Robert.

        Yes, I saw that the original post was old but, figured I would see if there was an answer.

         

        I am using TC 12.x.  In my situation, I have simple window (WinFormsObject) with a grid in it that I can only access with UIA.  It currently has about 2600 rows.  When using the Object Browser, TC waits forever.   Looking at the Task Manager processes, I see my app memory usage just keep climbing as TC tries to read the grid.  I am guessing Object Browser is trying to fill in with all the info in the grid.  I have been able to get the Object Browser to expand a bit and show the actual grid under the main window but it is hit and miss.  Not sure why it has shown the sub-objects a few times but most other times just sits and spins.

         

        I will open a new thread on my issue after I dig into things a bit more.  Thanks for your reply though.