google搜索 51Testing站内搜索                    软件测试门户 | 软件测试培 训 | 文章资料精选 | 软件测试论坛 | 软件测试博客 | 测试招聘求职 
打印

[求助] 自动测试过程中“忙窗体”的处理方法 New!

自动测试过程中“忙窗体”的处理方法 New!


如果手动制造一个忙窗体,然后再跑以下脚本时,没问题。但如果重新开始跑全部的脚本,然后到出现忙窗体时,就获取不到该忙窗体的属性值了。请教各位高手了,谢谢!测试工具是:Rational Robot
Dim Result As Integer,StateString As String,temp as integer
    On Error Resume Next
    DelayFor 3000   '主动延时3秒
    call pWriteLog("调用了Sub Change()")
    for temp = 1 to 5
        Result = SqaFindObject("\;Type=Window;Caption=忙窗体")
        if Result = 0 then
            goto lCloseWindow
        end if
    next
    if Result <> 0 then
        call pWriteLog("没有出现忙窗体!,result=" & result)
    end if
lCloseWindow:
    Do While (Result = 0)
        call pWriteLog("出现了'服务器忙,请稍后再试'忙窗体")
        Window SetContext,"Caption=忙窗体",""
        InputKeys "{ENTER}"
        Delayfor 5000
        Result = SqaFindObject("\;Type=Window;Caption=Caption=忙窗体")
        If Result <> 0 Then
            call pWriteLog("成功关上了忙窗体...")
            Exit Do
        End If
    Loop

[ 本帖最后由 yuxueqin 于 2008-2-22 12:19 编辑 ]

TOP

 
当前时区 GMT+8, 现在时间是 2008-10-14 14:46Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹