Forum Discussion

rlent's avatar
rlent
Contributor
14 years ago

Is it possible to temporarily disable name mapping?

Name mapping  is giving me problems when I have a child dialog. Name mapping gets confused between the parent dialog and the child dialog. I don't want to remove name mapping entirely, I'd just like to temporarily turn it off when I record a script when I have to deal with child dialogs.



The older scripts that deal with child dialogs still work, I'm able to use Sys.Desktop.ActiveWindow to avoid the ambiguity.

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    NameMapping will always be used for items that are already mapped.  however, you can turn off the option to automatically map items during recording.  Go to Tools | Options | Engines | NameMapping and turn off the option labeled Map object names automatically.
  • Ok, I turned that off, but it doesn't seem to have made any difference. With or without that checkbox checked, I still get



      Dim test

      Dim testMainForm

      Dim propertiesDialog

      Dim dataFieldPropertiesControl

      Dim textFieldSettingsControl

      Set test = Aliases.test



    Am I correct in that it shouldn't be referring to "Aliases" when recording a script with Name Mapping turned off?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    No.. because you have some items aliased already, when recording, TestComplete will still use those references.  It just won't automatically create NEW Aliases.
  • If recording is being a problem and you have "automatically map new objects" disabled you can temporarily change the recognition properties of the application's root object so that it is not recognized. For example if it is recognizing your application on the ProcessName property of "setup", change it to be "setupTEMP", record your script, then change it back.



    Just be cautious and make changes from the name mapping editor (http://smartbear.com/support/viewarticle/11942/), NOT the edit name mapping item dialog (http://smartbear.com/support/viewarticle/12483/); the dialog can only be opened if the item exists, and the changes you'd make would stop it from being recognized as an existing object.