做一个聪明的勤劳人,悠悠的。。。 温馨提醒:少喝奶茶;不吃刚烤的面包;远离充电电源;白天多喝水晚上少喝; 一天不喝多于两杯咖啡,少吃油多的食物;最佳睡眠为晚上十点至早上六点; 晚上五点后少吃大餐’ 每天喝酒不多过一杯; 不用冷水服胶囊; 睡前半小时服药忌立刻躺下; 睡眠不足八小时人会变笨; 有午睡的习惯人不易老; 手机电池剩一格时不要打电话,剩一格时辐射是平时的一千倍, 还要记得用左耳接电话,用右耳会直接伤害到大脑。

校验对象是否存在object.exist

上一篇 / 下一篇  2007-11-19 16:12:44 / 个人分类:QTP

除了用校验点来确认相符的对象是否存在外,也可以用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


TAG: QTP

 

评分:0

我来说两句

Open Toolbar