Forum Discussion
When the object name changes (in your example from buttonkeep to buttonkeep4), then the mapping for the old object name will not automatically apply to the new object.
You can adjust the mapping using wildcards so that it will try to match buttonkeep* instead.
https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html#InNameMapping
My problem is the object name should not be changing. I can put in new data with a new record within 15 minutes that uses the same data. So the object name doesn't change. In fact the title of the object is the same. In my example the name of object is Keep and it is a button. But somehow it loses this mapping. In this case the test is to copy data from a Word file into a websites textbox. It also does the same with a Excel spreadsheet data. After I paste the data into my textbox the dialog Keep comes up to so that this verified as information that is needed to be kept.
If the object name needs to be static, then that's something to discuss with your developers. TestComplete just reads what it finds, it doesn't create the object names.
In the meantime, the wildcards will keep the changing object name from affecting your tests. It's a common need among TestComplete users.
- Largent8034 years agoContributor
In my tests what it does even when I use the wildcards is tries to remap to a different object name each time the deal is created in the website. We are working with new deals all the time and I need it to be able to read the new deal that I create and then recognize that this object is the same object that was in the previous deal. However, at this point the deal is hitting the step and wanting to remap to a different buttonkeep. I just did it again with a new deal and the buttonkeep was remapped to buttonkeep10.
When I added the namemapping with wild cards here is how I added it //button[.='Keep?*']
Is this correct?
TestComplete is not going to automatically change the mapping because it has no way of knowing if that change in the name is a bug or something you expect to happen.
I would think it's something more like
buttonkeep*
What does the mapping look like if you map it right now, for buttonkeep10 or whatever the current value is?