Saturday, November 22, 2014

Difference between GetTo Property & GetRo Property?

GetToProperty

  • returns the value of the Property from the Test Object's description ie Value used by QTP to identify object.
  • Used to enumerate all properties of an object used for identification
  • Example (when object in OR) 
systemutil.run "iexplore.exe
Browser ("Google").navigate "http://yahoomail.com"
xyz = Browser ("Google").Page ("yahoomail:").webedit ("login").GetRoProperty ("name")
msgbox xyz

  • Example (When object is NOT in OR)
Set obj = Browser ("name:= Sign in to Yahoo"). Page ("title:= Sign in to Yahoo"). webedit (html id := username)
msgbox obj.GetToProperty ("html id")


GetRoProperty
  • allows us to get the current value of a test object.
  • Example
Print Browser ("A"). Page ("B"). Weblist ("C). GetRoProperty ("Select item index")

1 comment:

  1. Sumit
    is not the code
    Browser ("Google").navigate "http://yahoomail.com"
    xyz = Browser ("Google").Page ("yahoomail:").webedit ("login").GetRoProperty ("name")
    msgbox xyz
    be
    Browser ("Google").navigate "http://yahoomail.com"
    xyz = Browser ("Google").Page ("yahoomail:").webedit ("login").GetToProperty ("name")
    msgbox xyz

    ?

    ReplyDelete