字号: 小 中 大 |
推荐给好友
上一篇 |
下一篇
校验对象是否存在object.exist
发布: 2008-9-19 17:18 |
作者: qixiafeng |
来源:
51testing博客 |
查看: 109次 | 进入软件测试论坛讨论
领测软件测试网
|
除了用校验点来确认相符的对象是否存在外,也可以用object的exist属性来判断对象的存在与否.
语法:Object.Exist([Timeout])
描述:
Argument |
Type |
Descrīption |
Timeout |
Number |
Optional. The length of time to search for the object before returning a True or False value.
- If a timeout value is specified, QuickTest waits until it finds the object or until the timeout is reached.
- If the value 0 is specified, the method returns the True or False value immediately.
- If no value is specified, the value specified in the Test Settings dialog box for the Object Synchronization Timeout is used for tests. For business components, the pre-defined value of 20 seconds is used.
For more information on the Object Synchronization Timeout, refer to the QuickTest Professional User's Guide. |
实例:
Dialog("Login").Activate Dialog("Login").WinEdit("Agent Name:").Set "training" Dialog("Login").WinEdit("Agent Name:").Type micTab if Dialog("Login").WinEdit("Password:").Exist Then Reporter.ReportEvent micDone,"存在","控件存在" Dialog("Login").WinEdit("Password:").SetSecure "429376f06698f739df8bb1c09eab3d78dee316f7" else Reporter.ReportEvent micDone,"不存在","控件不存在" End If
|
文章来源于领测软件测试网 https://www.ltesting.net/
TAG:
object
Object
对象
校验
exist