Object name keeps changing when web app is relaunched
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/abou...)
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/
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without looking at the screenshots, I still go back to what I said. There is osmething mapped incorrectly in your NameMapping. The object in question has some sort of dynamic value, or the same object is mapped twice, or any number of things.
This isn't a matter of correcting the test itself but a matter of correcting the criteria used for mapping the objects. The tutorials and videos that we posted before are basically what we would have to walk you through to correct your problem. This is not a "quick fix" but, to some extent, a re-engineering of how your objects are identified.
You are correct, it is a problem for beginners because beginners rely solely on TestComplete's "auto mapping" to do all the NameMapping. And while the auto-mapping is useful for getting things started, it needs to be tweaked, maintained, modified, edited, etc., as you develop your tests for it to be sustainable in the long run.
Now, looking at your screenshots, I see one major glaring thing: Extended Find is checked ALL through your mapping. The Extended Find feature is useful and serves a good purpose. However, too much use of it will cause the type of confused mapping you are experiencing.
I hate to say it, but you're going to have to spend a LOT of work re-engineering your object mapping. Here's what I would do.
1) Go to Tools -> Options -> Engines -> NameMapping and turn OFF the check flag that says "Use extended find whenever possible".
2) Start working on re-naming your mappings. Looking at screenshots 5 and 6, screenshot 5 shows that it's just the main page while screenshot 6 seems to be mapping the login page. If you see the URL, you'll see what I mean. The mappings are different.
3) You may need to delete a LOT of object mappings and recreate them...and I know that means re-working a number of your tests. But that might end up being the solution with the least amount of headaches.
4) Go through the documents and tutorials and videos again. Learn how to manually map objects, how to edit mapped objects, etc.
I'm sorry, but that's the best we can do "at a distance".
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your valuable information. I will work on it and also read on more on Mapping and restart all over.
By deleting the project and starting a new one will clean the map list, I am assuming.
Thanks again.
