用Schedule定时运行QTP脚本

上一篇 / 下一篇  2007-06-20 18:22:41 / 个人分类:QTP

51Testing软件测试网P5F@Q$Km!U

创建一个.vbs,在控制面板的Schedule里面定义自己的task就好

IO4ZqpA/L X5N^0 51Testing软件测试网^3os `M

vbs的脚本如下:
Q0U[ Z w|*Y0
7_1iI.^^&W.y0Dim qtApp 'As QuickTest.Application ' Declare the Application object variable 51Testing软件测试网6Db b+f?|sJ
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable 51Testing软件测试网pi7l#d;MK}
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable 51Testing软件测试网/vF9\%lF#Y4~#K_biT*PQ J
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
2Qf9HY5^6d/`E Y0qtApp.Launch ' Start QuickTest 51Testing软件测试网 T1AMUWk U?
qtApp.Visible = True ' Make the QuickTest application visible 51Testing软件测试网a@b&orn:v9k.ry
' Set QuickTest run options 51Testing软件测试网d/cUcO [&[
qtApp.Options.Run.ImageCaptureForTestResults = "OnError" 51Testing软件测试网,f;UOl"FfT y
qtApp.Options.Run.RunMode = "Fast"
+t/d.b#Ne$_4y,~|!t0qtApp.Open "C:\ Your Test Path Here", True ' Open the test in read-only mode
J2y3Lx2^)G%s'H0' set run settings for the test 51Testing软件测试网VU U B/_
Set qtTest = qtApp.Test
q.Q/`9d7j]x0qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
7nt ~3o!?)wH{0Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
$Qn?!g`1pEc0qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location 51Testing软件测试网(s:QysfC3o7R
qtTest.Run ' Run the test 51Testing软件测试网S^rxGR#D/?0U}
'qtTest.Close ' Close the test 51Testing软件测试网+a*[x8|N9?a:h2j
Set qtResultsOpt = Nothing ' Release the Run Results Options object 51Testing软件测试网[Tk%Av
Set qtTest = Nothing ' Release the Test object 51Testing软件测试网.nO|nR
Set qtApp = Nothing ' Release the Application object 51Testing软件测试网^i \*P Vp n+zT

1d%?Q_;}5DU+k0

4DD&T#Er]W0

TAG: QTP

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-23  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

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

RSS订阅

Open Toolbar