[唐胡璐]QTP技巧 - 获取ToolTip几种方法

方法1. 
' Mouseover 
Browser("XXXX").Page("YYYY").Link("Link A").MouseOver 
' Wait 1 second to get the tool tip displayed. 
wait 1
' Capture the text of the tooltip object 
txt= Window("nativeclass:=tooltips_class32").GetROProperty("text") 
msgbox txt 
  
方法2. 
temp=Brower("name").Page("page").Image("imagename).GetROProperty("alt") 
msgbox temp 
  
方法3. 
temp=Brower("name").Page("page").Image("imagename).GetROProperty("tooltip") 
msgbox temp 
  
'google例子 
Dim a a=Browser("Google").Page("Google").Image("科幻小说家 H.G. 威尔斯的生日").GetROProperty("alt") 
msgbox a
posted @ 2013-01-24 09:01  唐胡璐  阅读(146)  评论(0编辑  收藏  举报