用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]"Fw3y P!V0Dim qtTest 'As QuickTest.Test ' Declare a Test object variable 51Testing软件测试网#?0^iT L&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{AO q;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
`_[,LQjE Xl0Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
;^$B`K8M LI4W0qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location 51Testing软件测试网0Lp 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

 

评分:0

我来说两句

我的栏目

日历

« 2024-02-27  
    123
45678910
11121314151617
18192021222324
2526272829  

我的存档

数据统计

  • 访问量: 9269
  • 日志数: 16
  • 建立时间: 2007-06-12
  • 更新时间: 2007-06-21

RSS订阅

Open Toolbar