Micro Focus QTP (UFT) Forums
Object Identification for similar objects - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Object Identification for similar objects (/Thread-Object-Identification-for-similar-objects)



Object Identification for similar objects - Taran - 09-19-2010

Hi

I am automating Windows Application based on .Net. There is one main object Role. Under this, there are many tabs(swfobject :class name) as:

Adminstration
Registration
Transactions
Reports
Tool Box
External Integration

I have to click Adminstration,Registration and Reports in my script. But the problem is all the properties of these above tabs is same as their main object viz. Role. QTP is not able to identify all the above tabs.

I tried to do recording to click the object.I got different statement for same object(eg.Registration) everytime as:

Code:
swfwindow("Roles Form").swfobject("Roles").click 166,12
swfwindow("Roles Form").swfobject("Roles").click 164,11
swfwindow("Roles Form").swfobject("Roles").click 169,7

These numbers after click keep on changing everytime.

Please tell how to click Adminstration, Registration and Reports.

Thanks
-Taran


RE: Object Identification for similar objects - venkatbatchu - 09-19-2010

Hi Taran,

Please follow the approach and hope it will solve ur issue.

Here objects are identyfying with x,y coordinates so we will proeed as per that only.
1. First find out the coordinates for "Administration" tab
This can be done using "GetTextLocation" (As it is a .Net application it will support this method)
2. Pass the x,y coordinates as arguments for click function.

Please let me know for further clarification.


Regards,
Venkat. Batchu


RE: Object Identification for similar objects - Taran - 09-19-2010

Hi Venkat,

I have seen all the tabs property through Object Spy. All the properties of these objects are same even x and y co -ordinates also.

Thanks
-Taran


RE: Object Identification for similar objects - venkatbatchu - 09-19-2010

Hi Taran,

It seems u might not be familiar with GetTextLocation property i hope by using this we can get the coordinates and pass the same thing for the Click.

Hope it will solve now....


Regards,
Venkat. Batchu


RE: Object Identification for similar objects - Taran - 09-21-2010

Hi Venkat

Thanks, now it is working perfectly.



-Taran