Forum Discussion

korrrro's avatar
korrrro
Occasional Contributor
7 years ago

Issue in displaying object tree

Hi,

 

I check out TestComplete as a tool to test C# application.

 

I faced the following issue - I’m not able to get object tree, when I go with Object Spy > Highlight object in the object tree I receive message "cannot highlight this object in the object tree" but this object exists on the screen and when I use function 'Highlight object on the screen' it is highlighted. It happens to each object I tried (WPFobject such as buttons, cells).

 

Any ideas why and how to see whole object tree? I 'm facing quite a lot dynamic grids so this would be very helpful.

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It would be helpful to know more about the application under test and what sort of object you're looking for.

     

    for example, I have an application that I work with that is actually displayed via an ActiveX object through Internet Explorer... so, the way that the object is present in memory is NOT the way that it is displayed in the Object tree so I get the same problem that you do... Now, I've found a way around it by performing some hocus-pocus with my object identification so you may need to do the same.

     

    What you see in the Object Spy is pretty detailed.  The only thing that viewing in the object browser would be the relationship between the object and the other objects in the hierarchy... but that is also visible in the Object Spy Window... look at the "Full Name" field and that should give you the hierarchal identification of your object.

    • korrrro's avatar
      korrrro
      Occasional Contributor

      Thanks for reply tristaanogre.


      AUT is a desktop application coded in C#, it includes a lot of data which is displayed within various grids. The easiest way is to give an example. Below is 'Full name' from Object Spy Window. It represents row selected in dynamically created grid. Dynamic object names are bolded. What is the best way to manage them and have robust test case always pointing that row ?

       

      Sys.Process("ApplicationName", 2).WPFObject("HwndSource:MainWindowControl").WPFObject("MainWindowControl").WPFObject("Grid", "", 1).WPFObject("DockManager").WPFObject("DocumentContentHost", "", 1).WPFObject("TabbedDocumentSplitPane", "", 1).WPFObject("Zcd8e29f28d584d54a3ba0e10487519ca").WPFObject("SplitPane", "", 1).WPFObject("Z45137e363ba64115b0e53fe050d7433a").WPFObject("Pane").WPFObject("DynamicEditingGrid", "", 1).WPFObject("Grid", "", 1).WPFObject("DynamicEditingGridControl").WPFObject("Grid", "", 1).WPFObject("DataGrid").WPFObject("Grid", "", 1).WPFObject("RecordListControl", "", 1).WPFObject("DataRecordPresenter", "", 3).WPFObject("DockPanel", "", 1).WPFObject("RecordSelector", "", 1)

      • korrrro's avatar
        korrrro
        Occasional Contributor

        In addition, most controls are Infragistics controls, for grids xamDataGrid control.

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    hi,

     

    as tristaanogre says you better use the nameapping in a way that you'll be sure that the properties you use to identify your objects (from the first parent to the last) don't change with unusable values (such as handles or so).

     

    you might use windowclass, class, caption, ...

     

    you'll have to avoid ambiguous namemapping therefore.