踏实,努力向上!
一个定时测试的方法(转)
上一篇 /
下一篇 2009-02-08 22:43:17
/ 个人分类:QTP
用Schedule定时运行QTP脚本
创建一个.vbs,在控制面板的Schedule里面定义自己的task就好
vbs的脚本如下:
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Open "C:\ Your Test Path Here", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Your Results Path Here" ' Set the results location
qtTest.Run ' Run the test
'qtTest.Close ' Close the test
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
这种方法还没试过,先收藏起来,侍有用时,再试下。
出处来自:
http://butestnote.spaces.live.com/blog/cns!58DD013E49E92756!144.trak
相关阅读:
- QTP无法启动 (wistaria, 2009-2-05)
- VBS中Sub与Function的区别 (胡奇, 2009-2-06)
- qtp无法录制iframe编辑器的问题 (lily4205, 2009-2-06)
- 获取WinListView的具体值,并导出表中 (lqp, 2009-2-08)
- winlistview中select的使用 (lqp, 2009-2-08)
- 写入TXT文件 (lqp, 2009-2-08)
- 拷贝的脚本无法用 (lqp, 2009-2-08)
- QTP中生成随机数 (lqp, 2009-2-08)
- QTP 关于文件的操作 (lqp, 2009-2-08)
- QTP-action模板 (lqp, 2009-2-08)
收藏
举报
TAG:
QTP