Forum Discussion

jenli's avatar
jenli
Contributor
15 years ago

What is the recommended way to map objects? Manual or Automatic

What the advantages  and disadvantages to do name Mapping automatically or manually?

5 Replies

  • Hi Jennifer,


    Automatic name mapping uses the default recognition criteria which may not be reliable for your particular application in some cases. Creating a name mapping scheme manually is more reliable because you can specify recognition criteria for each item manually and use the properties which are known to remain persistent in further versions of the tested application (for example, if there are multiple similar panels on the same level of objects hierarchy and you know that only one of them will remain visible, you can map the object by using the Visible property). Also, you can use the Extended Find feature to make TestComplete find an item regardless of its position in the objects hierarchy when you create a name mapping scheme manually. Please see the "Name Mapping - Overview" ( http://www.automatedqa.com/support/viewarticle.aspx?aid=3827 ) and "Using Extended Search Criteria for Mapped Object Identification" ( http://www.automatedqa.com/support/viewarticle.aspx?aid=2884 ) help topics for more information.


  • If we do the Name Mapping mannually, what is the better way to do it: from the bottom of the object tree or from the top of the object tree?

      For WPF applications, if the UI control has the Name Element, we do not need to use the name mapping. For example, in XAML code: we have <Button Name="loginOK_btn"  ....>

                            ......

                        </Button>



      In my sccript,  this button can be accessed progrmatically as: processName.WPFObject("loginOK_btn").
  • Hi Jennifer,




    what is the better way to do it: from the bottom of the object tree or from the top of the object tree?



    Start from the top - that's the default way. Even if you start from a low-level object, you will need to map its parent objects first anyway.




    For WPF applications, if the UI control has the Name Element, we do not need to use the name mapping.



    You can map the object via the unique property just to have the same way of addressing objects in all of your tests. However, you can use both Name Mapping and full names if you want to avoid Name Mapping in some cases.


  • Thank you for your quick response.



         The full name of any control or object is the unique property. Can we just use the full name as the selected property for name mapping instead of trying out to find other persistent properties in the control for name mapping?




      Best regards,



     Jennifer
  • Hi  Jennifer,


    I recommend that you use the item's native name ("loginOK_btn", not "...WPFObject("loginOK_btn")" in your case) to map the objects - this approach is more reliable.