不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。
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{^+Ml51Testing软件测试网q[6k*Jt N\1R;g语法:(Syntax)
51Testing软件测试网*g CP Ul
vk;p0mmYB b.kmK2M0status% = SQAFindObject(recMethod$)
5gwunuq3p03f8x*[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#N A
在这个例子中,自定义检查函数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_Rxp'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
相关阅读:
- 测试用户名及密码的登录小程序 (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技术