In QTP how do you test if two fields has same properties?

Questions by nikila

Showing Answers 1 - 12 of 12 Answers

Sycho

  • Nov 21st, 2007
 

hi,

Basiclly when QTP record some action on the application. It identify an object and its mandaotry properties information and store it in its Object Repositry. But when it founds two objects with similar information then it also capture some assitve (Optional) properties information for object so that two object have different Object information its Object Repositry and can be identified uniquely.

Regards,
SYCHO

  Was this answer useful?  Yes

It shows same in manidatory properties so, we can go to assistive property in that we can select msw id means Microsoft window id, it is unique. so it is the best thing

  Was this answer useful?  Yes

Sycho

  • Dec 17th, 2007
 

Hi,

Are you asking for the following answer. Please reply

You can also use GETTOPRPOPERTIES method of Test Object which returns collection of properties for test object. you can then get name and value of the each property for the test object.

Using this approach you get get the properties collection of two object and can compare their values using IF ELSE statement.

For Button 1
Set Properties = Dialog().WinButton1().GetTOProperties
PropertiesCount = Properties.Count

For i=0 to PropertiesCount-1
Property_Name1 = Properties(i).Name
Property_Value1 = Properties(i).Value

For Button 2
Set Properties = Dialog().WinButton2().GetTOProperties
PropertiesCount = Properties.Count

For i=0 to PropertiesCount-1
Property_Name2 = Properties(i).Name
Property_Value2 = Properties(i).Value

IF Property_Name1=Property_Name3 AND Property_Value1=Property_Value2 THEN
MsgBox "Object are Same"
ELSE
MsgBox "Object are not Same"
END IF


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions