Function RightMouseAction( UI_object, Menu_index)
Set obj = CreateObject("Mercury.DeviceReplay")
Set WshShell = CreateObject("WScript.Shell")
Dim i
'Get the absolute coordinates of the ibject
absx = UI_object.abs_x
absy = UI_object.abs_y
obj.MouseClick absx+3, absy+3, 2
'Optional wait statement
wait(2)
'Menu_index = 4
For i = 1 To Menu_index
WshShell.sendkeys "{DOWN}"
wait(1)
Next
WshShell.sendkeys "{ENTER}"
Set WshSEll = nothing
Set obj = nothing
End Function
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","C:\Documents and Settings\jie.wu","open"
Browser("Browser").Page("Page").Sync
Browser("Browser").Navigate "http://172.16.192.49:8080/index.asp"
Browser("Browser").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Sync
Set links=Browser("欢迎访问动网先锋论坛[动网先锋论坛]").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Object.links
For each objLink in links
If objLink.innerhtml="自动化测试" Then
' 第二次判断的时候就会出错,因为前一次已经导致当前页面翻转
reporter.ReportEvent 0,"寻找指定Links",objLink.innertext & ":已经找到"
If objLink.innerhtml="测试&灌水" Then
' 第二次判断的时候就会出错,因为前一次已经导致当前页面翻转
reporter.ReportEvent 0,"寻找指定Links",objLink.innertext & ":已经找到"
'Browser("欢迎访问动网先锋论坛[动网先锋论坛]").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Link("innerhtml:=自动化测试").Click
'call RightMouseAction (Browser("欢迎访问动网先锋论坛[动网先锋论坛]").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Link("innerhtml:=测试&灌水"),2)
' Exit for
End If