Forum Discussion

Christie's avatar
15 years ago

Mapping a TabPage object

In my application, none of the TabPage containers (under Microsoft.Practices.CompositeUI.WinForms.TabWorkspace) are named.  I think TC8 is generating names to be used for NameMapping.



The problem is that when I run any test that was recorded, I get an object does not exist error.  It doesn't matter what type of test I recorded, Keyword, JScript, or VBscript.



The application has hundreds of unnamed TabPage objects, so I need a solution that doesn't require our developers to give them all names.



Any suggestions?



Many Thanks

2 Replies

  • Hi,



    The problem is that identifiers of your controls are dynamic. To overcome this, you can map your tab pages by some properties with stable values (such as ClrClassName or ObjectType) and specify child objects by which TC will recognize them. If each container has unique children, this will allow you to identify your tab pages without assigning static names to them.



    Also, I recommend that you watch this webinar recording about Name Mapping.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I second the namemapping thing.  That is a LIFESAVER when working with dynamically named objects.  In a previous life, I worked with an application that had hundreds of windows, literally, that had, effectively, the same name resolved by TC.  However, by mapping that name coupled with a couple of other properties, I was able to uniquely identify each of those instances and reference them as such without having to jump through any hoops of dynamic searches.