不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。
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]04BML4D5`E(k.iq0status% = SQAFindObject(recMethod$)
51Testing软件测试网3l0og B4dk!|#v Yv7u.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|6ER
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
相关阅读:
- 测试用户名及密码的登录小程序 (Spark.lee, 2007-1-05)
- 检查当前是否有ie浏览器开着,如开着,需把它关掉 (Spark.lee, 2007-1-05)
- 用Robot实现登陆界面的大数据量测试 (Spark.lee, 2007-1-05)
- 用Robot实现登陆界面的压力测试 (Spark.lee, 2007-1-05)
- 修改table中的数据,使用SQASetProperty函数 (Spark.lee, 2007-1-05)
- SQAWaitForPropertyvalue 函数使用 (Spark.lee, 2007-1-05)
- 函数调用 文件关联 (Spark.lee, 2007-1-05)
- SQAUtil.sbl (Spark.lee, 2007-1-05)
- SQADatapoolOpen参数解释 (Spark.lee, 2007-2-05)
- script structure(脚本结构) (Spark.lee, 2007-2-05)
收藏
举报
TAG:
Robot技术