51Testing软件测试网;| SC&ivv5q(iGetTOProperty和GetROProperty都用于取出对象的某个具体属性的值,它们的语法和用法几近相同,唯一的区别就是GetTOProperty取出的是录制对象的属性值,而GetROProperty取出的是在回放过程中运行的对象的属性值.51Testing软件测试网aed
{,T
51Testing软件测试网9V5SX{W,CGetTOProperties,是指取出录制对象的所有属性。
@dXl:{vvo!N1\051Testing软件测试网m(ea|O'`
m-uGetTOProperty和GetROProperty语法都是:
Tt6{Baf051Testing软件测试网~!i/O6SmW(Fdobject.GetTOProperty(Property)
F|:zo@t(qC,c)h051Testing软件测试网X~s*`G$xZU*G@A或者是:
$Md2|9YI3zq@5n051Testing软件测试网T.eh'{i0mobject.GetROProperty(Property)51Testing软件测试网[3D&lLy#}u.e
51Testing软件测试网5zf)X|b!ER:\其中Property,对象的属性,是必填项.51Testing软件测试网 bvf/VQFHP
AsV \$[)]8Aq0GetTOProperties的语法为:
_R8h$x%^'x F-Q&`N0object.GetTOProperties
+R}m8@"`0W%a ^E*|0实例:
5y!x/C+gR'r)|)Y4o0U%D0` Elh+Zpv0Dialog("Login").Activate
A(A|d0z*t,uY$}0Dialog("Login").WinEdit("Agent Name:").Set "training"51Testing软件测试网U3O'zVi$oLs
Dialog("Login").WinEdit("Agent Name:").Type micTab51Testing软件测试网]b0h!mHx
J
Dialog("Login").WinEdit("Password:").SetSecure "429376f06698f739df8bb1c09eab3d78dee316f7"51Testing软件测试网U+{;UN0Wt'~f
Set TableDesc = Dialog("Login").WinEdit("Password:").GetTOProperties51Testing软件测试网+?p2z.W%n(U;Z
I
Properties=TableDesc.Count51Testing软件测试网` w~'|VX
reporter.ReportEvent micdone,"属性数目",Properties51Testing软件测试网6|8p7x,X|J
If Dialog("Login").WinEdit("Password:").GetROProperty("attached text")="Password:" then
\$Y nov0 reporter.ReportEvent micdone,"name控件","存在"
Z`%y1}bU6w(Dx0 else
b/e:_8iW#s0]0 reporter.ReportEvent micdone,"name控件","不存在"51Testing软件测试网;Kg N5H^
end if51Testing软件测试网b
R,oeC
U
If Dialog("Login").WinEdit("Password:").GetTOProperty("attached text")="Password:" then51Testing软件测试网sk)o[qm@
reporter.ReportEvent micdone,"name控件2","存在"51Testing软件测试网_d&UI#cw6~3O1y
end if51Testing软件测试网e%g7f!XPIB7K"gsA
Dialog("Login").WinButton("OK").Click
_i5]!lx K'~X2S0'did the flight reservation window appear?
+e~riI'E)c0Window("Flight Reservation").Check CheckPoint("Flight Reservation")
;sT Sz,{o6aC'k0Set Mydes=Descrīption.Create()
'CZ G#b*Q8X0Mydes("attached text").value="Name:"
F6rq
Pef
e0Mydes("nativeclass").value="Edit"51Testing软件测试网m8BJT5Bq.tJO~6J'y
51Testing软件测试网1^Ur
l5U7\SSet winedites=Window("Flight Reservation").ChildObjects(Mydes)
:Zj&L/`9o t0NoOfChildObjs =winedites.Count51Testing软件测试网:\hn%q:Ir.A1j+O_p
For Counter=0 to NoOfChildObjs-151Testing软件测试网/?r1m"ea$r L5W
if(Counter=0) then51Testing软件测试网J/J7{$t:RY
winedites(Counter).Set "ON"
K.|@D
\"^ ]0 end if
e?HK\7ee0Next
a2JP4~ j&z*r O8m#iR3P&k#y0