不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。                                           it is no use doing what you like, you have got to like what you do.

SQAfindobject函数解释

上一篇 / 下一篇  2007-02-05 16:02:56 / 个人分类:Robot技术

SQAfindobject  ------搜查指定的对象51Testing软件测试网Va4n/A%L{ ^+Ml
51Testing软件测试网q[6k*Jt N\1R;g
语法:(Syntax)51Testing软件测试网*g CP Ul vk;p0mm

YB b.kmK2M0status% = SQAFindObject(recMethod$)
5gwunuq3p0
3f8x*[W9CT Qjm0::If SQAFindObject does not locate the specified object immediately, it returns sqaObjectNotFound
SZ6l:Y:vX'H)Vdg0
wO8q1I#l @1Uv"Q{0Example: SQAFindObject Example   51Testing软件测试网4oC*b I7_ w*ylh:U

_NKFXx0In this example, the user-defined function CheckForOKCancelButtons verifies that the current window contains an OK and a Cancel button. It returns either sqaPass or sqaFail.51Testing软件测试网)w:I|1Mz#NA
在这个例子中,自定义检查函数OK/CAECEL,检验当前窗口OK和Cancel按纽内容,返回值为通过或者失败

wi7z[ Q!vZ+AW0Function CheckForOKCancelButtons () As Integer

    Dim Result as Integer
    If SQAFindObject("Type=PushButton;Text=OK") = sqaSuccess And
        SQAFindObject("Type=PushButton;Text=Cancel") = sqaSuccess
        Then Result = sqaPass
     Else
        Result = sqaFail
    End If
      'Get the recognition information for current context window
pd3a*Eg_Rx p't0    //获得当前上下文窗口的识别信息
    Dim CurrentWindow As Variant
    SQAGetProperty ".\", "Recognition", CurrentWindow
    SQALogMessage Result, "Test for existence of OK and Cancel buttons", "Window being tested: " + CurrentWindow
    CheckForOKCancelButtons = Result
End Function

应用上面函数的例子:
Sub Main
    Dim Result As Integer
    Window SetContext, "Name=myApp", ""
    MenuSelect "File->Open..."
    Result = CheckForOKCancelButtons()
End Main
{9owo`}I+y6UE0
)mm;B4R&w0
h}RyO5fg3d.A0

TAG: Robot技术

 

评分:0

我来说两句

Open Toolbar