Micro Focus QTP (UFT) Forums
Identifying an object of same name on different screens - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Identifying an object of same name on different screens (/Thread-Identifying-an-object-of-same-name-on-different-screens)



Identifying an object of same name on different screens - learnasugo - 06-08-2011

Hi,

I am working on Terminal Emulator and my problem is that I am not able to identfy an object that has the name same as the 1st one that appears on the 1st screen on subsequesnt screen.
Here's the scenario.
I have an object that appears on 3 screens and I want to either use the one on the 2nd or 3 rd screeen, and not the 1st obne on the 1st screen.
What QTP does is that on the 1st screen, where that object appears only once, it does not matter which index I use for that object, it identifies it. On the 2nd and 3rs screens, the object appears twice on each screen, and in that case, the indexes 0 and 1 do assist in identofying the cirrect objects.
So if I use If .TeField("objectname").Exist, it always identifies the one on the 1st screen. Please assist. What must I do to ignore the 1st object on the screen in cases where I do not want to use that object on the 1st screen? :-( I am really frustrated :-( Your assistance will be very much appreciated.


RE: Identifying an object of same name on different screens - rajpes - 07-05-2011

You need to first identify the parents(screens) as unique,
Check in object repository if you have different hierarchy for each of those objects.If no, add some mandatory property like 'title' for browser.
I guess you have only one object in repository