51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3228|回复: 5
打印 上一主题 下一主题

[原创] 校验对象是否存在object.exist

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-3-7 11:38:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
除了用校验点来确认相符的对象是否存在外,也可以用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
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2007-3-9 16:49:36 | 只看该作者
恩,不错,总结的挺好,再接再励!
Fight!!
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2007-5-14 11:06:07 | 只看该作者
恩,不错,总结的挺好,再接再励!
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2007-5-14 17:07:35 | 只看该作者
谢谢 ~~学会了~~呵呵
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2007-6-13 18:51:10 | 只看该作者
谢谢
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2007-6-14 10:47:35 | 只看该作者
学习收下了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-22 14:31 , Processed in 0.079026 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表