|
出现QTP内部错误时,如:找不到对象。可以跳过直接运行以下步骤的方法:
在file->settings->run 中 When error occurs during run session 设置为procced to next step
或者使用全局错误处理机制:代码中加上 on error resume next
至于重新运行的话,目前我不知道有这个设置,
你可以用脚本实现,
If onerror Then
msgbox "aa"
Call Rerun()
End If
Function Rerun()
projectPath = Environment("TestDir") & "PracticeError"
Dim qtApp
Dim qtTest
Dim qtResultsOpt
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.Open projectPath, TRUE, TRUE
Set qtTest = qtApp.Test
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = projectPath&"\result"
qtTest.Run qtResultsOpt, True
End Function |
|