16,554
社区成员
发帖
与我相关
我的任务
分享
'创建oMTM自动化模型组件
Set oMTM = CreateObject("MultiTestManager.Application")
'获取报告设置对象
Set oReportSettings = oMTM.Preferences.ReportSettings
'获取运行设置对象
Set oRunSettings = oMTM.Preferences.RunSettings
'设置为可见模式
oMTM.Visible = True
'设置运行后关闭QTP以及MTM
oRunSettings.CloseQuickTest = True
oRunSettings.CloseTestManager = True
'设置创建报告,并在运行完毕后打开报告
oReportSettings.CreateReport = True
oReportSettings.ReportName = "IQuickTest Report"
oReportSettings.ViewReport = True
'加载需要执行的脚本,并设置为
oMTM.AddTestScript "c:\test1",True
oMTM.AddTestScript "c:\test2",True
oMTM.AddTestScript "c:\test3",False
'执行脚本
oMTM.Run
'直到运行完毕
While oMTM.IsRunning : Wend
'释放对象
Set oRunSettingss = Nothing
Set oReportSettings = Nothing
Set oMTM = Nothing