V0r&NM[ M,P
eN
r0QTP的基本使用函数:51Testing软件测试网Q vy'U_\cm6k
E
51Testing软件测试网H jf_"L G1,获取对话框相应的文字:GetVisibleText51Testing软件测试网'S7L*t.W
k^C
T-p,H"T0z RA(d02,查找相应的字符串:instr(1,查找目标字符串,所查找的字符串)
6k4\z;JZV2wz/Sp0K%K'h0u{*YmE9c F#JX,a03,随机数的获取:Randomnumber.Value()或cstr(int(Rnd*10) 1)
I!K8o#Q:nU051Testing软件测试网I
zP&gG8]4,等待函数:Wait(秒数)
8wItz(p s051Testing软件测试网Z9I5\ v$e*d5,获取数组下标:UBound(数组名)
2Z.A Q5P@ S `e[0]d3~,Ey!g&`}06,拆分数组:Split(MyString,",",-1,1)
Zq;f0]o?*}Y
~051Testing软件测试网"]M)g9d g7i8Nv*q7,可执行步骤:OptionalStep51Testing软件测试网 ptK~r!b{
ivq!ka P4K,E08,报告信息:Reporter.ReportEvent3,"SaveStep","Outofcycle!"51Testing软件测试网hGf,T8O1P6k-g"h
51Testing软件测试网Q#X?,`#j"B2K{n9,判断对话框是否存在:.exist
e};y/G&mO[W00Mz7c,Q%\vtqD)u010,事件过滤函数:Reporter.Filter=过滤条件(0,1,2,3),0代表显示所有的error和warning,1,显示error,2,显示waining,3,任何error和warning都不显示。
`2XD/II1?YX03w6\_:q5J@!C&B011,循环函数:do…loopuntil,for…to…thennext,while.
rO.C$O(VRVa7H0t0Dq4B
E+n012,数据表格:DataTable,向外赋值,Dimaa=DataTable.value(“CellingName”,”ActionName”).51Testing软件测试网m?l2B)oG"hmT
H
51Testing软件测试网'p0P#^1Tr+x,Y*{13,获得对象属性的三种方法GetTOProperty,GetTOProperties,GetROProperty,GetTOProperty获得程序中对象当前的属性,GetTOProperties获得当前属性所有集合,GetROProperty获得的是录制时对象所获得的属性。51Testing软件测试网f&E9U{(KM:ZL
51Testing软件测试网}?2\3UU/a,U14,检查点方法check和输出指定属性值output。
o"UJ,XU W051Testing软件测试网`j?2jw8r%aN15,函数Descrīption,可以获得某页面同标签的属性进行操作。51Testing软件测试网7{%X0\'@ HR;yf:]n
51Testing软件测试网&O{3n+d/l16,函数nagative可以随便跳转页面到指定的URL。
4S
y&sm/fw,^-r3P.`
R M0mAo#k9R017,函数Object可以获得当前页面同属性的控件。51Testing软件测试网)DUp"M$_ak3i
-|%\C:y
H b018,函数Focus可以让控件获得焦点,函数Blur则是失去焦点,click单击,dbclick双击。
^
[V9jz|i!sh)N051Testing软件测试网u2Rw[Y!v5`D.b19,函数setAttribute可以设置控件属性,getAttribute可以获得属性。
!S
M`6S9F0