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?
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.
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.
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.
Found the answer helpful? Give it a Kudos by clicking Like! Got your issue resolved? Click Mark as Solution so others can find it quickly.
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.
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.
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.
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.
In Alias path when you move one node to a higher parent it will automatically prompt you to update all KeywordTest script references.
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.
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.
Found the answer helpful? Give it a Kudos by clicking Like! Got your issue resolved? Click Mark as Solution so others can find it quickly.
Thank you. I read it, may be I still do not get all but it works step by step
this helps:)
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.