Xe ?%G(Qb|.I01. dos命令的执行51Testing软件测试网^.wB2k u~_a
Dim oShell
4Ae R
V/vbM2qY0Set oShell = CreateObject ("WSCript.shell") 51Testing软件测试网t-?)~EP+`,Fz&b
oShell.run "cmd /K CD C:\ & Dir" 51Testing软件测试网wg:m%Wz"^8\BYg
Set oShell = Nothing 51Testing软件测试网TNy'Y
Y-x
2.使用可选步骤
jwi`,EZ@0OptionalStep.Browser("browser_name").Page("page_name").Link("link_name")
|pouV nc$}2t0
Q#TM)j'l7k4dv0
默认可选步骤
默认情况下,QuickTest 将打开下列对话框的步骤视为可选: 51Testing软件测试网lrS Ys2j
51Testing软件测试网'gM$B IOZ!@f-k-o
对话框标题栏 51Testing软件测试网A
jq7os+O2D
|
自动完成
|
文件下载
|
Internet Explorer
|
Netscape
|
输入网络密码
|
错误
|
安全警报
|
安全信息
|
安全警告
|
所需的用户名和密码
|
3. 处理运行错误
W-lhWl&tJ2R!?0q5`8Ked0P
M5X:X%N`0
- 停止 - 停止运行会话。51Testing软件测试网\
Z CSY*uW
如果 QuickTest 配置为在运行后显示测试结果,则会显示测试结果。
- 重试 - QuickTest 尝试再次执行该步骤。51Testing软件测试网nY
{
E&oY7g
如果该步骤成功,则运行会继续。
- 跳过 - QuickTest 跳过引发错误的步骤,然后从下一步骤继续运行。
- 调试 - QuickTest 暂停运行以便对测试或组件进行调试。51Testing软件测试网,JOEW+}`6\2|K^
可以执行本章描述的任何调试操作。在调试之后,可以从测试或组件停止的那一步开始继续运行会话,也可以使用单步命令来控制运行会话的其余部分。
- 帮助 - 对于显示的错误消息,打开 QuickTest 故障排除帮助。在查看“帮助”主题之后,可以在错误消息框中选择另一个按钮。
- 详细信息 - 将消息框扩展为显示其他有关错误的信息。
A'S3d.u[3D&@4}04.51Testing软件测试网:S&coS!b+v0s
下列语句指示 QuickTest 等待打开“航班表”对话框时最多等待 20 秒。
5\/z1{
{2pBP0
blnDone=Window("Flight Reservation").Dialog("Flights Table").Exist
a1gx_ }`>5jM0
counter=1 51Testing软件测试网,OXS;g)bW
While Not blnDone 51Testing软件测试网 m8d/k@;dh/D;fQ C1t+J
Wait (2) 51Testing软件测试网#Q;Rd#^0Q7p%I]!qfh
blnDone=Window("Flight Reservation").Dialog("Flights Table").Exist 51Testing软件测试网q3E+v1l;JN1_!bH&h
counter=counter+1 51Testing软件测试网kvDf7SlF
If counter=10 then
2C*Y}a A]-[EX0
blnDone=True
J]/N+gd iu0
End if
m5a|aKF,zD'k/I0
Wend51Testing软件测试网0Y,\ol,V?4E i
#d1x0a3Zy4W{
^05. ExecuteFile "c:\test.vbs"51Testing软件测试网 y*uuRsc`.x{
6. msgbox Environment.Value("home")
L8L
i?&^{H
F%Qe07.请教不将测试结果记录到日志的语句。51Testing软件测试网s,\|l+[%h9M t(z mWF
对于已知是错误的验证点,在测试报告中能否记录通过,或者根本不记录呢?
7Q*k)a'^N^,{1g V0
Reporter.Filter = NewMode
W-aZ6K R0
The mode can be one of the following values:51Testing软件测试网:m
~`Y]X sv8Z
Mode 51Testing软件测试网"i0N/a1c)vP9m5B,V
Description
)K} rfk:l2QkE0
0 or
$bl8W(Uep0rfEnableAll Default. All reported events are displayed in the Test Results. 51Testing软件测试网 Xn9x.Pv
1 or rfEnableErrorsAndWarnings Only event with a warning or fail status are displayed in the Test Results. 51Testing软件测试网3A7]9EO&t&i6RP
2 or
.K
WC`fG;hU,D8@0rfEnableErrorsOnly Only events with a fail status are displayed in the Test Results.
xk Ya8d-O.Ia03 or
j"X
^w3A#]^9n8_P0rfDisableAll No events are displayed in the Test Results.
/@w r-hZ2q/vi0 8.库中不需要有对象存在也可执行:51Testing软件测试网OTwCa(O~
k
Dim aaa,bbb
a$LC;a&K\0aaa="Login"
D|y5W.MUz0bbb="OK"
0v/G-pi"HtNCn0Dialog("Title:="&aaa).Activate
M^+X-W4z;oW~0Dialog("Title:="&aaa).WinButton("text:="&bbb).Click
CYw"JnSQ{u*u09.setting的应用举例51Testing软件测试网0wv Mu,U*K
If Setting.Exists("Tester Name") Then
jXuB9\*G0 Setting.Remove ( "Tester Name")
s"I i8h
tb#bB0End If
cIVn-W0
Setting.Add "Tester Name", "Mark Train" 51Testing软件测试网ntum
J&D
Setting("Tester Name") ="hello"
!sf
uO4E]
gNd0MsgBox Setting("Tester Name")
w"~^d-I4f{L2vkw@010.qtp 关键字头+空格(技巧)
eak{W0
51Testing软件测试网4ji&nW!K;h7[
c
g\51Testing软件测试网)_H[6?
l/i;_p%B/u'E&I
Ff0]H]:_8On*Du
}0Link URL:
http://www.cnblogs.com/tester2test/archive/2006/07/20/455425.html