用Schedule定时运行QTP脚本
上一篇 /
下一篇 2007-06-20 18:22:41
/ 个人分类:QTP
51Testing软件测试网P5F@Q$Km!U创建一个.vbs,在控制面板的Schedule里面定义自己的task就好
IO4ZqpA/L X5N^0
51Testing软件测试网^3o s`Mvbs的脚本如下:
Q0U[Zw|*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软件测试网/v F9\%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/cUc O [&[
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`1p Ec0qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location 51Testing软件测试网(s:QysfC3o7R
qtTest.Run ' Run the test 51Testing软件测试网S^rxG R#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
Vpn+zT
1d%?Q_;}5DU+k0
4DD&T#Er]W0
收藏
举报
TAG:
QTP