Forum Discussion

Nformation's avatar
Nformation
Contributor
11 years ago

Objects with same name need to be mapped differently.

In WinForms, I need to test with multiple tabs open as seen below.  However, both "Work Queue" and "Watch List" have the same MappedName and FullName, so playback fails to execute anything on the "Watch List" tab because it's actually trying to access the "Work Queue" tab.  How do I distinguish these objects in TestComplete?









Here is how they look in the object tree. Same name.









And here's name mapping.  I tried adding the caption as a mapped object property as shown (and added "WList" to the mapped name"), but this did not cause the program to distinguish between the tabs.  Any suggestions?




  • Hi,


     


    I guess this thread is related to this one, right?


     


    Judging by these threads, I guess that you need to do the following changes in Name Mapping:


    1. To the DocumentManagementFormWList mapped object, you will need to add the Visible property or some other property (VisibleOnScreen, Active, etc.) that will indicate that the current tab is opened at the moment. You can find the needed one in TestComplete's Object Browser. 


    2. You may need to use the RefreshMappingInfo method to update the mapped objects after switching between tabs.


     


    Let us know how it works for you.


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,


     


    I guess this thread is related to this one, right?


     


    Judging by these threads, I guess that you need to do the following changes in Name Mapping:


    1. To the DocumentManagementFormWList mapped object, you will need to add the Visible property or some other property (VisibleOnScreen, Active, etc.) that will indicate that the current tab is opened at the moment. You can find the needed one in TestComplete's Object Browser. 


    2. You may need to use the RefreshMappingInfo method to update the mapped objects after switching between tabs.


     


    Let us know how it works for you.


     

  • Thanks, Tanya!  That did the trick.  I used the VisibleOnScreen property.  I had tried refreshing mapping and had tried adding a property, but I hadn't tried both.  This is a big help. Thanks again.