51Testing软件测试论坛

标题: 论坛测试问题??? [打印本页]

作者: rivermen    时间: 2007-6-1 18:13
标题: 论坛测试问题???
有一个论坛。打开之后有这么一些板块:
自动化测试
测试&灌水
环境搭建
疑难杂症
行业领域业务知识
软件测试外语版
[attach]26588[/attach]

我怎么样才能同时打开每一个板块,各自独立一个页面?
考虑过用鼠标右键,然后"在新窗口打开":

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 & ":已经找到"
               
                call RightMouseAction (Browser("欢迎访问动网先锋论坛[动网先锋论坛]").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Link("innerhtml:=自动化测试"),2)
          
        End If

        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

Next

问题1:
效果不好,第一个新页面打开后。准备打开第二个性页面的时候,坐标的位置失真了?
不知道怎么处理?

问题2:
在for 循环中
For each objLink in links

call RightMouseAction (Browser("欢迎访问动网先锋论坛[动网先锋论坛]").Page("欢迎访问动网先锋论坛[动网先锋论坛]").Link("innerhtml:=自动化测试"),2)


为什么不能用
call RightMouseAction(objLink ,2)

等待高手解答。
作者: walker1020    时间: 2007-6-2 10:50
对于第一个问题,根据你的描述,你就不要用 坐标作为识别对象的属性呀
作者: rivermen    时间: 2007-6-4 13:24
自己顶,希望有使用“鼠标右键选择打开” 的比较成熟的案例




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2