Object name keeps changing when web app is relaunched
Hello. I am fairly new to TestComplete and having problems in getting my script to run everytime.
It complaints about not finding the object, and the reason was that the object name changed.
For example, when I recorded my script using the keyword method, the object names are captured, for instance this "Aliases.browser.pageImagenet.buttonNewPatient" get records for a create button but when I relaunch the web app and run the script again the object gets changed to "Aliases.browser.pageImagenet2.buttonNewPatient", it added a 2 (see attachment). When I remove the "2" the button is found again. Again, I am new on this but I read something about adding a wildcard/expression in the object. What is the best approach, I am sure I will have lots of this same problem in the web app and I would like to start understanding it. I heard of Mapping Objects, but I am not familiar with it either. What are my best options to make automation testing easier.
Also, I want to use this same script on other Windows computers so i want to keep this in mind, when finding the right solution to this dynamic change.
I learn best my examples so if you can show me how the object should be written and any other tips to avoid no object is found errors from happening.
Thank you very much for your help.
This topic has already been discussed several times in the forum.
Please take a look at the following topics related to the topic:
This topic is more elaborate than I thought at the beginning of my adventure with TestComplete.
If these threads do not help you, I can help you.
As Wamboo , this is a common issue that stems from inaccurate mapping of objects. Read through the articles but I'd also recommend going through the documentation topics on NameMapping. (https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/about.html)
There is also a brief tutorial video on the issue. It's based off an older version of TestComplete but the concept is still relevant.
https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/