Forum Discussion
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.
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?
- Marsha_R4 years ago
Champion Level 3
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?
- Largent8034 years agoContributor
NameMapping.Sys.browser.pageCruisehbApptest.buttonKeep11
//div[14]/div/div/div/div/button[contains(@class, 'fr-keep-word')]
or //div[14]/div/div[2]/div/div/button[2]
or //button[.='Keep?*']
The other ones are very similar except that they will have the //button[.='Keep?*'] as the first item.
The system will change this every time I recreate a new deal it will want a different buttonkeep number..
- Largent8034 years agoContributor
I just re-did the test and again its now up to buttonKeep15. Basically, I can look up the old Namemapping and see the other mapped objects from other times I have run the test and they do include the old mapped steps but since it is showing up as a new test it is wanting to remap to a new buttonKeep with new number. I need it to stop doing this because this is just to save the data into the textbox when the test gets finished it is completely done as with the data in the textnode. So the button is for saving to the textnode and is correct. My checkpoints validate the data as I am working through it.