Forum Discussion

yingkai1208's avatar
yingkai1208
Contributor
11 years ago
Solved

Remap dialog object in which most of controls stay same

Hi, 



I mapped a dialog, but due to new feature introduced, developer changed the dialog name, and all old mapped names in the dialog disappeared. 



Since most of controls in the dialog stay same, instead of remapping all controls anew, is there an easy way to move the previous mapped ones to the new dialog?



I searched possible solution in the manual, the only valuable content I found is from 

http://support.smartbear.com/viewarticle/57334/

Instead of mapping the application’s objects anew, you can rearrange the existing items in Mapped Objects



But there is no further detailed solution in terms of how to 'rearrange the existing items in Mapped Objects'



Any advice is appreciated.



Cheers

Kai
  • The article describes how to edit an object that has been mapped.  Essentially, you mapped an object and one of the properties you used (apparently) to uniquely identify the object within test complete is the caption.  When the caption changed, TestComplete can no longer find the object.  The solution is to go to NameMapping, find the object in NameMapping, edit it, and change the caption.  Take a look at the screenshot attached for the simple example from using the notepad application.  



    1. I found the notepad dialog in NameMapping and selected it


    2. In the right hand side, I clicked on the button beside the WndCaption property to open the edit dialog


    3. In the edit dialog, I can now change the caption to be something different.


    You have several options at the point in how you want to edit the caption.  You could make it a constant, essentially being the new value after the code changes.  Or, you could define a variable on the project level that you could assign the caption to in order to make your NameMapping more fluid.



    Other options are to find other mapping identifieers on your dialog other than the caption that are not going to change as frequently.  This would reduce the fequency of how often you would have to go through this edit process.



    Hope this helps.





5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The article describes how to edit an object that has been mapped.  Essentially, you mapped an object and one of the properties you used (apparently) to uniquely identify the object within test complete is the caption.  When the caption changed, TestComplete can no longer find the object.  The solution is to go to NameMapping, find the object in NameMapping, edit it, and change the caption.  Take a look at the screenshot attached for the simple example from using the notepad application.  



    1. I found the notepad dialog in NameMapping and selected it


    2. In the right hand side, I clicked on the button beside the WndCaption property to open the edit dialog


    3. In the edit dialog, I can now change the caption to be something different.


    You have several options at the point in how you want to edit the caption.  You could make it a constant, essentially being the new value after the code changes.  Or, you could define a variable on the project level that you could assign the caption to in order to make your NameMapping more fluid.



    Other options are to find other mapping identifieers on your dialog other than the caption that are not going to change as frequently.  This would reduce the fequency of how often you would have to go through this edit process.



    Hope this helps.





  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Hello!



    That particular article applies, apparently, to a shift in hierarchy of the mapped objects.  The problem you're describing, if I'm reading it correctly, is not that the hierarchy has changed but that the properties that you're using to identify the object (namely the dialog name/caption) have changed.



    Most likely, you'll want to modify the Mapped Object to use different values for the mapped properties.  Check out this article for more information on how to do that.



    I think, once you edit the dialog to have the new name, you should be good to go.
  • Hi Robert, 



    Thanks for the reply.



    You read my question correctly. The only change is the dialog's caption, all the controls on this dialog stay same. So instead of deleting the mapped object and all its child objects, and then remap them. (It is what I do now), is there an easier solution I could use?



    The artical in your reply seems could not solve the issue



    Cheers.

    kai
  • Hi, Robert



    Thanks for replying.



    I deleted all mapped controls under the dialog, and remapped them.



    Cheers.

    Kai