Forum Discussion

jmassey's avatar
jmassey
Contributor
9 years ago

How to detect control that is not listed as child

I am new to TestComplete and trying to get it to identify a Tree style of control inside of a dockable section of our program. TestComplete identifies the panel the tree is in as an explorerPane, but it doesn't identify the tree within at all. That is, the pane is a leaf node in the object tree, there are no children. It seems like what I need to do is some kind of object mapping, but the Object Browser does not show any children of the pane, so I don't know what object I can tell it to map. Is there some way to get it to enumerate everything, even things it does not recognize?

 

I am also confused about the Object Mapping process, as it says to use the WndClass value for the Object Name, but that value is seemingly the same in Object Browser for everything in the application from the Main Form down.

 

Attached is an image of the part of the program I'm trying to access, along with the tree for that section from Object Browser.

 

 As an additional note, I've also tried using Text Recognition to identify these items, but that also does not seem to work.

  • Thanks for the screenshots. It doesn't look like these objects are based on known supported controls, so they need a different approach. There are a few ways to deal with custom controls like these:

     

    1) Usually custom control have a property or method that contains the item data, something like DataSource.Item(index).Text. Data properties may also be named Items, Rows, or similar. For example, on your screenshots, ProjectExplorer has the DataSource and DataBindings properties that look relevant, and explorerPanel has the DataBindings property. Examine these properties in the Object Browser (by clicking the [...] button) to see what data is inside them. Or better yet, if you are in contact with the application developers, ask them which properties and methods you can use to access the tree items.

     

    2) You can try to enable MSAA, UI Automation or Text Recognition for your custom objects. Sometimes this helps TestComplete to identify items as separate objects.

    • Go to Tools > Current Project Properties (not Default Project Properties).
    • Under Open Applications, select MSAA, UI Automation or Text Recognition (any one of them).
    • Add WindowsForms* to the list and select the check box next to it.
    • Save your project.
    • Refresh the Object Browser.

    Hope this helps!

    • jmassey's avatar
      jmassey
      Contributor

      I did try these methods, but none of them have worked. It may not have been clear from my initial post, but the explorerPanel is not, itself, the unrecognized TreeView. It is the content pane that contains the unrecognized object. The object itself simply does not appear in the Object Browser at all; that is my problem that I am trying to resolve. Is there some way to get TestComplete to at least list the contents / children of the pane, even if it does not recognize them, so that I can then map them? Or is there some other approach to this problem that I should be taking?