Micro Focus QTP (UFT) Forums
QTP- identifying same objects with same properties - 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: QTP- identifying same objects with same properties (/Thread-QTP-identifying-same-objects-with-same-properties)



QTP- identifying same objects with same properties - sumalatha - 06-12-2009

Hi,
Can anyone tell how to identify two objects say of same webclass "WebEdit" which has same properties , through descriptive programming in QTP?


RE: QTP- identifying same objects with same properties - niranjan - 06-13-2009

use index


RE: QTP- identifying same objects with same properties - prasadworld321 - 01-28-2010

Observe the below code, how the 2 'search' button of 'www.google.com' works using ordinal identifier.................


Code:
SystemUtil.Run "iexplore.exe","google.com"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set "QTP script"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Submit
Wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=0").Highlight
wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=1").Highlight



RE: QTP- identifying same objects with same properties - Unleash Rajesh - 05-19-2011

Hi,

Could u plz explain this code...
What for you have mentioned the name as q, if i changed this and execute it throws an error........

Code:
SystemUtil.Run "iexplore.exe","google.com"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set "QTP script"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Submit
Wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=0").Highlight
wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=1").Highlight



RE: QTP- identifying same objects with same properties - deepaksporty - 05-20-2011

I guess you should use object spy to find properties which may differ. if you find one then add that property to your test object property set.

We use ordinal Identifier only when All Mandatory or Assistive or Smart Identification fails.

DP is never used to work on similar objects, its used only when the object changes properties dynamically.

I an not quite sure why you want to use DP, you have to use a property in DP which would be different for the two set of button so why not add them to you Test Object property set.


RE: QTP- identifying same objects with same properties - Langxii - 07-20-2011

Would you tell me how to get index? . I spied two webedit are same object properties but i don't see index. Only tell me the difference is outerhtml of two webedit. Would you let me know how to set value each webedit.


RE: QTP- identifying same objects with same properties - rajpes - 07-20-2011

Langxii, index is applicable only if all other properties of those webedits are same.Moreover it is used when qtp is not able to distinguish between objects, in your case, it is not identifying webedit itself due to some other problem


RE: QTP- identifying same objects with same properties - souvikghosh_diatm - 07-20-2011

@@Langxii:--


What rajpes has said that is absolutely correct...but would like to mention one thing, basically index property can not be found by spying any object.....if u add that object in repository, that time u can find it under ordinal identifier section.....And if index is not there then there must be some properties which makes those two webedits differs from each other....u hav to find out those properties......


if any doubts are there then send me two different screen shots of your OR after adding those objects in OR.....


----------
Thanx.


RE: QTP- identifying same objects with same properties - abhishekjain_87 - 08-07-2012

Hi All,

I have an windows application to test. The Object in the page has all the properties same. I am unable to run a script because the QTP doesn't enter data in the fields. Please help me what should i do to handle the above mentioned issue.

All Most all the properties are same they gave class name as Windows throughout the fields in a page. All other properties are also same. Finding it really difficult to solve the Issue. please reply if any one can help me regarding this.

Hi All,

I have an windows application to test. The Object in the page has all the properties same. I am unable to run a script because the QTP doesn't enter data in the fields. Please help me what should i do to handle the above mentioned issue.

All Most all the properties are same they gave class name as Windows throughout the fields in a page. All other properties are also same. Finding it really difficult to solve the Issue. please reply if any one can help me regarding this.