校验对象是否存在object.exist

发表于:2007-4-05 14:16

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:qixiafeng    来源:51testing博客

除了用校验点来确认相符的对象是否存在外,也可以用object的exist属性来判断对象的存在与否.

语法:Object.Exist([Timeout])

描述:

Argument

Type

Descrīption

Timeout
Number
Optional.The length of time to search for the objectbefore returning a True or False value.
  • If a timeout value is specified, QuickTest waits until it finds theobjector until the timeout is reached.
  • If the value0is 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 theObjectSynchronization Timeoutis used for tests. For business components, the pre-defined value of 20 seconds is used.
For more information on theObjectSynchronization Timeout, refer to theQuickTest 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

原始链接:http://blog.51testing.com/?61184/action_viewspace_itemid_4632.html

《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号