用Schedule定时运行QTP脚本
上一篇 /
下一篇 2007-06-20 18:22:41
/ 个人分类:QTP
Q/p-o#V[,tz ?
jt0创建一个.vbs,在控制面板的Schedule里面定义自己的task就好51Testing软件测试网${hi|*P:?
"h!}U}Y0vbs的脚本如下:51Testing软件测试网(^^ x9d(l&t$Z
51Testing软件测试网q8\e#`
YQGR
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
9c/_8VZ.de]"Fw3yP!V0Dim qtTest 'As QuickTest.Test ' Declare a Test object variable 51Testing软件测试网#?0^iTL&A
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
!v$Dm!gu*A0Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
#^wFBhuBEm m0qtApp.Launch ' Start QuickTest 51Testing软件测试网VS7Dkc8@Jd{
qtApp.Visible = True ' Make the QuickTest application visible 51Testing软件测试网
}+G^@h
' Set QuickTest run options 51Testing软件测试网8c'D(VG#u(XNTq
qtApp.Options.Run.ImageCaptureForTestResults = "OnError" 51Testing软件测试网fz,K(C!k2{:v
qtApp.Options.Run.RunMode = "Fast"
!C0P8{AOq;Fb'L0qtApp.Open "C:\ Your Test Path Here", True ' Open the test in read-only mode 51Testing软件测试网P%@RO-F!J `
' set run settings for the test 51Testing软件测试网uk!V5Z1m/J
Set qtTest = qtApp.Test
U;b\7cO9u{ o0qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
`_[,LQj E X l0Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
;^$B`K8M
LI4W0qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location 51Testing软件测试网0L p
Eb6JJ+K}_
qtTest.Run ' Run the test
*z KE$o
S
x,}0'qtTest.Close ' Close the test
A^E4s"rT&F0Set qtResultsOpt = Nothing ' Release the Run Results Options object 51Testing软件测试网lS'Vn(}FREM#|*v(zj
Set qtTest = Nothing ' Release the Test object
`K!d2c
Ql0i0Set qtApp = Nothing ' Release the Application object
^;Td
Gl#c&D:d7j0
p3p2A#lS,Bv.c0
3f @Kl,f-z*eh/V0
收藏
举报
TAG:
QTP