How to get Tool tips in QTP?

  •  Hover(Place) your mouse(over the element) to check whether the UI element has a tool tip associated with it.
  • If it has a tool tip associated, make use of QTP’s object spy tool and check the property that contains the tool tip value.
  • Most of the times, you will find that tool tip is present in title property.
  • Use GetRoProperty to fetch the tool tip value.

a)Webelement:

msgbox  Browser("Google ").Page("Google ").WebElement("India").Object.title

(OR)

Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My Yahoo!").FireEvent "onmouseover"

wait 1

ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text")

Msgbox Tooltip

b)Image:

msgbox Browser("Google").Page("Google").Image("Google").GetROProperty("alt")                   

  '(or)

If Browser("Yahoo! India").Page("Yahoo! India_2").Image("Bigg Boss goes desi").Exist Then

strToolTip=Browser("Yahoo! India").Page("Yahoo! India_2").Image("src:=http://l1.yimg.com/t/images/bb_22111_60a.jpg").GetROProperty ("ALT")

msgbox strToolTip

Reporter.ReportEvent micPass, "ToolTip Property of object Quote", "ToolTip Value Captured"

Else

Reporter.ReportEvent micFail, "ToolTip Property of object Quote", "ToolTip Value NOT Captured"

End If

c)Link:

msgbox Browser("Google").Page("test - Google Search").Link("Link").GetROProperty("title")

Comments

Popular posts from this blog

Is QA a easy job?

Latest Version of TestComplete

Successful tester