求解:使用vb启动uft脚本,uft启动成功后又自动退出了。
使用vb启动uft脚本,uft启动成功后又自动退出了。直接运行uft则正常。各位有没有遇到这种情况,代码如下:Dim qtApp
Dim qtTest
Dim qtResultsOpt
Dim projectPath
projectPath = "F:\GUITest8"
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Open projectPath, True
Set qtTest = qtApp.Test
qtTest.Run
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = projectPath & "\QTPReport"
qtTest.Run qtResultsOpt,True
qtTest.Close
qtApp.quit
Set qtResultsOpt = Nothing
Set qtTest = Nothing
Set qtApp = Nothing qtTest.Run
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = projectPath & "\QTPReport"
qtTest.Run qtResultsOpt,True
为什么要qtTest.Run 2次?不太懂楼主的用意 抱歉,qtTest.Run这个是我多写了。
页:
[1]