对产品质量来说,不是100分就是0分

校验对象是否存在object.exist

上一篇 / 下一篇  2007-03-07 11:38:36 / 天气: 晴朗 / 心情: 高兴 / 个人分类:QTP

查看( 1619 ) / 评论( 5 )
51Testing软件测试网+s7c2O(q#['n J~

除了用校验点来确认相符的对象是否存在外,也可以用objectexist属性来判断对象的存在与否.51Testing软件测试网c\#f6On7Z.B?G

_4k7ri2^ s"oI;\0语法:Object.Exist([Timeout])51Testing软件测试网E#bU/wo!i&P

w"@c XkG4G0描述:51Testing软件测试网Y9Q6a5F.za"^3zUi

7h$J6}y'v-\$W'q0

Argument

7`e)K,lhxy I/~t0

Type

TS:g'A-a)C3z0

Descrīption

:Z$I jo)w\c1s K E h0
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.

Wb+kw!Q5Kip^a051Testing软件测试网7VBDx3@

实例51Testing软件测试网 {|v+a%L3[ fkT:j%xG

51Testing软件测试网7r)K2rmw

Dialog("Login").Activate
,K3pO(~edG0J"E0Dialog("Login").WinEdit("Agent Name:").Set "training"51Testing软件测试网oHG%B:d2Nh
Dialog("Login").WinEdit("Agent Name:").Type  micTab51Testing软件测试网m Xpd\)lp
if Dialog("Login").WinEdit("Password:").Exist Then51Testing软件测试网5p$dU kd
 Reporter.ReportEvent  micDone,"存在","控件存在"51Testing软件测试网&KJ7sL@:ro$M+b&@
 Dialog("Login").WinEdit("Password:").SetSecure "429376f06698f739df8bb1c09eab3d78dee316f7"51Testing软件测试网_1xp#r B#oQ4[
 else
&zd;_9M!s0 Reporter.ReportEvent  micDone,"不存在","控件不存在"51Testing软件测试网&G9QHSrrhRU
End If51Testing软件测试网3v u)mB%V$`0hU;g-DP'w
51Testing软件测试网3aw-Lw8ux(h L TW

51Testing软件测试网Q.`%ty(psHRe:fQ

51Testing软件测试网!ue ^\d4R h%~

x!sN P,k(q0

-XPiP;G UU|7]N0
相关阅读:

TAG: QTP Object exist 对象存在

红狐发布于2007-03-09 16:49:36
恩,不错,总结的挺好,再接再励!W
kQLH@

Fight!!
alanxzg发布于2007-05-14 11:06:07
恩,不错,总结的挺好,再接再励!
milan330330的个人空间 milan330330 发布于2007-05-14 17:07:35
谢谢 ~~学会了~~呵呵
Learning for English or Everything kheng-ling 发布于2007-06-13 18:51:10
谢谢
terrylight发布于2007-06-14 10:47:35
学习收下了
我来说两句

(可选)

Open Toolbar