|
学习QTP,用www.baidu.com,做例子,运行代码后,title=Browser_Page.Object.title:Msgbox tilte,这句弹出的box没有任何参数,而
Msgbox Browser("micClass:=Browser").Page("micClass:=Page").Object.title这句是有参数“百度一下,你就知道”
Set dpBrowser=Description.Create()
dpBrowser("micClass").Value="Browser"
Set dpPage=Description.Create()
‘dpPage("title").Value="百度一下,你就知道"
dpPage("micClass").Value="Page"
Set dpWebButton=Description.Create()
dpWebButton("name").Value="百度一下"
Set dplink=Description.Create()
dpLink("name").Value="关于百度"
dpLink("html tag").Value="A"
Set Browser_Page=Browser(dpBrowser).Page(dpPage)
title=Browser_Page.Object.title:Msgbox tilte
Msgbox Browser("micClass:=Browser").Page("micClass:=Page").Object.title
With Browser_Page
.WebButton(dpWebButton).GetROProperty("Value")
.Link(dpLink).Click
End with
Set Browser_Page=Nothing
Set dpLink=Nothing
Set dpWebButton=Nothing
Set dpPage=Nothing
Set dpBrowser=Nothing |
|