TestComplete keeps losing mapping of objects
I am using the full version of TestComplete and when I setup a test I will get the object setup once when it has been recorded. However, the next time I run the test often times the test will lose the mapping of the same object.
For example I enter a button click the system maps it to buttonkeep in namemapping. However, I will go back with new information with a new set of data that will use the same button click and that click no longer works and the error says the buttonkeep could not be found. I will then remap it and it will go from something like buttonkeep to buttonkeep4.
Something is causing the Testcomplete not to find the mapping of the buttonclicks.
I have found similar problems with other mapping issues.
Solved! Go to Solution.
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.
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.
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
What does the mapping look like if you map it right now, for buttonkeep10 or whatever the current value is?
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..
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.
The system still comes up wanting to remap the buttonKeep. I have tried adding a buttonKeep?* and a *.*
Basically, it is wanting to remap everytime I rerun the test. Which would be often. I need to make it so that it will allow me to set
it up once and then be able to run the test over and over again.