Forum Discussion

smcmickle's avatar
smcmickle
Contributor
13 years ago

Update after renaming objects in NameMapping

Hello again!



Suppose I have made a series of tests that have already worked, but then I wished to make the tests easier to read by updating all of my names / moving the NameMapping tree around.. Is there a way to automatically update the script, or do I have to manually update the script?



I have finally proposed to my company that NameMapping all of the objects to an understandable format would be very beneficial for the future and would like to pretty much re-NameMap the entire program.



Thanks for the help!



-Sean

3 Replies


  • Hi Sean,


     


    Automatic update of mapped names is possible only in keyword tests. Unfortunately, you will have to manually update your scripts :(.


     

  • Thank you Tanya!



    I suppose it wouldn't be hard to just find and replace names. Maybe I can make a program to find the names and change them based on comparing NameMapping files!  :-)
  • vajindarladdad's avatar
    vajindarladdad
    Frequent Contributor
    Hi Sean,

    First of all , Thanks to Tanya for her answer.

    To add to her answer , please try to give same aliases name to reduce your work.

    Here is an example for the same:



    Imagine you have a function X , where you have used mapped object using aliases.



    Public function X()

    Dim test



    set test = Aliases.Object.1.Object2.Object3

    call test.Click



    End Function



    Now suppose , there is a change in the object hierarchy and you have to map all the objects again. For this time , map all the required objects , please try to maintain the same hierarchy as it was previos for aliases, so that there won't be any change in the current function.



    Note: You can not change the hierarchy in Name-mapping tree BUT you can change the hierarchy of aliases.

    Also to add further , please try to make aliases list as short as possible.



    I hope this has been some help.