When I write test script (Descriptive programming) in QTP/UFT, I find difficult to figure out & choose unique properties for objects identification, now here I want to know that is there any way to figure out the best unique property for the same kind of objects.
1 Answer
Sometimes there is not a single property which will uniquely identify the object and we have to use a number of properties to identify the one we are looking for. In my experience, you keep adding properties/attributes in your descriptive code until you find the object. I always start with "html id"or "name" if there is one available as most of the times that is unique. If it is not I would always ask the developers if there are any specific reasons to do. Sometimes it takes them just a few seconds to add such unique property so it is always better to ask them! To achieve uniqueness, I have used combination of "micclass", "innertext", "html tag", "visible" and "title" properties but there may be more you can use depending on your project.
I hope it is helpful.