不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。                                           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  ------搜查指定的对象
D9Ge1]*| pCP0
@?/u)h*j#ah0语法:(Syntax)
;{cY&Vt bh]0
4BML4D5`E(k.iq0status% = SQAFindObject(recMethod$)51Testing软件测试网3l0og B4d k

!|#vYv7u.B;fS9g+X0::If SQAFindObject does not locate the specified object immediately, it returns sqaObjectNotFound
#\i^9` ]#ri*e051Testing软件测试网)Xv!i$F8K7HP/F8JD
Example: SQAFindObject Example   
4T IXH-WK qL5~051Testing软件测试网-h T(wP{Y(G |6E R
In 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软件测试网6^aa'r X C+|
在这个例子中,自定义检查函数OK/CAECEL,检验当前窗口OK和Cancel按纽内容,返回值为通过或者失败
51Testing软件测试网6em3yHF#b.F KbR8J
Function 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 window51Testing软件测试网/J0fyve
    //获得当前上下文窗口的识别信息
    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
+z#~ \tt!W-pd051Testing软件测试网]|}9g!W1F
51Testing软件测试网 J.nXl+`rVDf

TAG: Robot技术

 

评分:0

我来说两句

Open Toolbar