|
Action1
Browser("micClass:=Browser").Navigate "bbs.51Testing.com"
Call NavigatePage("[QuickTest Professional]","论坛")
Function NavigatePage(linkName,keyWord)
Set objBrowser = description.Create()
objBrowser("micClass").value = "Browser"
Set objPage = description.Create()
objPage("micClass").value = "Page"
Set objLink = description.Create()
objLink("html tag").value = "A"
objLink("text").value = linkName
Dim checkTitle
Browser(objBrowser).Page(objPage).Link(objLink).Click
checkTitle=Browser(objBrowser).Page(objPage).GetROProperty("title")
'验证title,如果checkTitle字符串含有“keyWord”,则表示成功进入某页面
If Instr(checkTitle,keyWord) <> 0 Then
Reporter.ReportEvent micPass,"NavigatePage","Pass"
Else
Reporter.ReportEvent micFail,"NavigatePage","Fail"
End If
Set objBrowser = nothing
Set objPage = nothing
Set objLink = nothing
End Function
Run Error:
Cannot identify the object "[ Link ]" (of class Link). Verify that this object's properties match an object currently displayed in your application.
求高手解答,本人是初学者。 |
|