updating already mapped items to new objects

Originally posted by alex4286 on August 05, 2025

Dear Support Team,

I’m currently working on a test project where the system under test has changed, and as a result, several previously mapped UI objects are no longer available (they are missing or have new identifiers). I would like to replace an already mapped object in the NameMapping with a newly identified object, but I cannot find a way to do this directly.

Currently, the only way I see is to:

Delete the old mapping,

Create a new mapping,

And then manually update all test steps that reference the old mapped object to point to the new one.

This is highly inefficient for larger projects and prone to human error.

My question is:
Is there a supported way in TestComplete to reassign or relink a mapped object to a different actual object in the repository, without deleting it and updating all affected test steps manually?

Originally posted by alex4286 on August 05, 2025

example I have mapped Object A. It is used in 10 Tests. It was unhapilly recognized as Fullpath, no ID available, so structure changed and it can not be find anymore. I wanted to edit mapped object A in name mapping , so it gets new Object. But Object path there is hardcoded , i can change only attributes of old object.

Originally posted by alex4286 on August 05, 2025

So i mapped new object again and deleted absolete mapping. but now I have to update all steps where old object was used in all 10 Tests. That is somehow not convenient.

Originally posted by Hassan_Ballan on August 05, 2025

Hello alex4286​ this is a community driven channel, if you need to contact SmartBear support https://support.smartbear.com/testcomplete/docs/general-info/getting-support.html?sbsearch=support%20SmartBear#ContactSupportTeam

What you are experiencing is a basic functionality of NameMapping and it’s purpose is to provide you control specifically for your situation. I suggest that first you familiarize yourself with its details https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/name-mapping/index.html

There are two parts to NameMapping Objects and Aliases, TestComplete does a good job in auto mapping but I suggest that you design and build it step by step keeping in mind maintenance. You would only need to update the Alias node selectors https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/how-to/update/index.html and all KeywordTests references are updated automatically. Please note, when if statement/while statements or using code based script changing the Alias path would not reflect in your scripts and you will have to perform a search and manually replace.

:speech_balloon: Found the answer helpful? Give it a Kudos by clicking Like!
:white_check_mark: Got your issue resolved? Click Mark as Solution so others can find it quickly.

Originally posted by alex4286 on August 07, 2025

thank you very much Hassan.

alias node selectors seems to be only for web objects.

Problem is still that I can not replace object or its alias which is used in 1000 tests with another object.

Example: button has fullpath a.b.c.d after refactoring it has a.b.d

TC doesn not find it now. If try to edit button mapping it is not possible to replace it with new button object.

so I need to map new button extra and rework all 1000 tests manually.

I there a possibility not to do like this?

Originally posted by alex4286 on August 07, 2025

even AutomationID does not help.

there is a ButtonDeleteImage:

WPFControlAutomationID : DeleteCurrentImageButton

NameMapping.Sys.Carestream.HwndSource_this.zthis.MainWindowGrid.Grid.Grid.Grid.Grid.Grid.Grid.Grid.this_.ButtonDeleteImage

Aliases.Carestream.HwndSource_this.zthis.this.ButtonDeleteImage

after Refactoring it is not recognized using DeleteCurrentImageButton AutomationID:

new object is :

Aliases.Carestream.HwndSource_this.zthis.this_ref.WPFObject(“Grid”, “”, 1).WPFObject(“MenuBottomLine”, “”, 1).WPFObject(“Grid”, “”, 1).WPFObject(“Grid”, “”, 1).WPFObject(“Button”, “”, 2)

and it still has same WPFControlAutomationID : DeleteCurrentImageButton

Originally posted by rraghvani on August 07, 2025

As an example, Object Browser shows the following details for the button

Sys.Browser(“chrome”).Page(“https://www.w3schools.com/css/css3\_buttons.asp").Panel(2).Panel(0).Panel(“belowtopnav”).Panel(0).Panel("main”).Button(1)

The button has the following name mapping

Sys.browser.pageCssButtons.panelCss.panelCss.panelBelowtopnav.panelCss.panelMain.Button(1)

If the properties used to identify the button has changed, this can be verified and updated via “Check for Name Mapping updates” button

The Alias name mapping still remains the same

However, if the hierarchical structure changes i.e. where Button(1) no longer belongs to Panel(“main”), then you will have to perform name remapping. But you can still keep the alias name of Aliases.browser.pageCssButtons.buttonCssButton.

Originally posted by alex4286 on August 07, 2025

Thank you. for me is Huerarchical change very interesting.

Can you explain more how to proceed? Please

I try this but seems not always to help.

1 OLD hierhic. object is mapped with alias “Aliases.xxxxx.HwndSource_this.zthis.a.b.c.Button”

2 i map NEW hierar. object to Aliases.xxxxx.HwndSource_this.zthis.ButtonNEW

3 i delete "Aliases.xxxxx.HwndSource_this.zthis.a.b.c.Button"in NameMapping list

4 rename ButtonNEW to Button in NameMapping list

but some how it is not always working :frowning: it still shows that object not found

5 looking in test steps where button used it shows “Aliases.xxxxx.HwndSource_this.zthis.a.b.c.Button” so its not updated

I think promlem is that I only change last label - Aliases.xxxxx.HwndSource_this.zthis.Button

this part “Aliases.xxxxx.HwndSource_this.zthis.” remains unchanged and makes Problem?

I hope you understand my problem :slight_smile:

_____ _____

other may be more simple case

in tests I always click on Ok Button

but I want now always to clik on Cancel button.

can I simple change mapping from ok to cancel in name,mapping list? so i do not need to update all places in tests where Ok was used.

Originally posted by alex4286 on August 07, 2025

object 1 is used in manu tests and needs to be replaced

replace with object 2

How can I replace Object1 with Object2 ? so that Alias remains from Obj1 but has Properties of Obj2,

Test steps expects this :

Originally posted by alex4286 on August 07, 2025

resolved. thanx

may be it will be cool if test complete would have an easy button just to assign new object to mapped alias . like using in object spy

Originally posted by Hassan_Ballan on August 07, 2025

I re-suggest having a good read of https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/index.html to have deep understanding on how it works to be able to manipulate.

The links to navigate: Mapped Object > Mapped Alias > Script reference
In your script you can right click on an action to select speed menu to take you the the Mapped Alias, similarly from the Mapped Alias you can right click on the node to select speed menu to find the Mapped Object.

  1. In the following I intentionally made the path different from Object and Alias to reflect how it actually operates. When you rename Mapped Object Sys.a.b.c.d.e.Button to ButtonOld it will automatically prompt you to rename the Mapped Alias Aliases.a.b.Button and all KeywordTest script references.

  2. When your application mapping path change, and since your scripts are referencing the Alias you can simply modify the Object by drag and drop Button from “e.” to higher parent “d.” from Sys.a.b.c.d.e.Button to Sys.a.b.c.d.Button. In other cases you can even move it up to “c.” and enable/check the extended find to search for it in all children. NOTE: Object and Alias path should not contradict and usually the Alias path skips many of the Object path nodes.

  3. In Alias path when you move one node to a higher parent it will automatically prompt you to update all KeywordTest script references.

  4. The Object and Alias node identification are one and the same. You can update the node identification (by clicking on the image button refresh) and all script references do not need to be updated but are affected immediately.

  5. You can copy an Object node from one project to another, than drag it and drop it in the Alias, and copy the Alias path to use in your script action.

I suggest you create a test project to play with as you can easily make an irrecoverable mistake.

:speech_balloon: Found the answer helpful? Give it a Kudos by clicking Like!
:white_check_mark: Got your issue resolved? Click Mark as Solution so others can find it quickly.

Originally posted by alex4286 on August 07, 2025

Thank you. I read it, may be I still do not get all but it works step by step

this helps:)

  1. When your application mapping path change, and since your scripts are referencing the Alias you can simply modify the Object by drag and drop Button from “e.” to higher parent “d.” from Sys.a.b.c.d.e.Button to Sys.a.b.c.d.Button. In other cases you can even move it up to “c.” and enable/check the extended find to search for it in all children. NOTE: Object and Alias path should not contradict and usually the Alias path skips many of the Object path nodes.

I mapped new object to get correct hierarc. Then moved old and already used button to new place where new object was.