I am testing and Ajax application and facing problem with Dynamic object IDs. I am trying to use wild cards but it is not possible mos of the times as there are multiple objects in the hierrachy with same Classname/ObjectType properties. See screenshots.
The only difference these objects have are the properties that I don't want to use for object identification (like height, width, conztent, text, ID, offset and similar...) because we have seen in the past that either these props change in different enviornment or Development team can change these (lijke childs, ID) anytime over a period of time.
Is there any foolproof method for object recognition which I can try in name mapping?
Solved! Go to Solution.
The full proof method is for you to enter a bug report against your R&D and let them know that dynamic naming is causing a problem in testing and that you insist on them naming their panels with a unique ID in order for you to complete your job successfully and not waste company's resources because they insist on doing this wrong.
If that is not possible and R&D has no intention of developing the AJAX based site correctly, you might have to dig deeper to find a property or an array of properties for that Object that you can count on. If all of them keep changing as you mentioned, I am not sure what TestComplete can do for you, there is no magic.
Finally, what are you trying to do with the Panel? click it? access its children? What is the end result? You probably not interested in the panel itself but what's inside of the panel and that is what you should concentrate on.
Let me know more and I will try to help
I wouldn't shy away from using contentText. It can help distinguish one object from another with some judicial usage.
Ya, that is clear. But what about multilanguage applications ?
In the application that I am testing has language switching option. And every customer has his own language library. That would be last option to do object recognition and validation with text content. (That too with multiple OR gates with different translated texts for each language).
Is there any other thing we can do to reduce this kind of maintenence effort in future?
I wouldn't run all functional test on all the languages. I'm assuming changing language doesn't change functionality. If you need to automate the checking languages, I would limit that to a few, just to make sure that the translation code is working. For that, you can use conditional mapping to use OR logic for properties.