QTP之自动批量执行自动化测试脚本的函数
上一篇 /
下一篇 2013-07-12 15:15:36
/ 个人分类:QTP自动化测试
'============================================================================
' 函数名称:ExcuteTestScript
'
操作系统: win7
' 脚本作者: xxx
' 编写日期: 2013-7-10
'
测试功能:自动批量执行
自动化测试脚本
'============================================================================
Sub ExcuteTestScript
'创建
QTP对象
Set qtApp = CreateObject("QuickTest.Application")
'启动QTP
qtApp.Launch
qtApp.Visible = True
'设置运行模式
qtApp.Options.Run.RunMode = "Fast"
'设置运行结果视图为false
qtApp.Options.Run.ViewResults = False
'运行指定的脚本
For i=1 To n
'打开脚本
qtApp.open a(i)
'创建测试的对象
set qtTest = qtApp.test
'运行测试脚本
qtTest.Run
'捕获错误后,继续运行下一行代码
on error resume next
Next
'脚本运行完毕,退出QTP
qtApp.Quit
'释放qtp对象
Set qtApp = Nothing
End Sub
Call ExcuteTestScript
'获取运行完毕的时间的小时数
收藏
举报
TAG: