我正在使用QTP自动化对象模型来运行测试:
Set qtpObj = CreateObject("QuickTest.Application") 'Creates an instance of the QTP
以这种模式进行BUTP时,QTP不会显示任何错误对话框(带有“停止”,“跳过”,“调试”按钮),就像在“打开错误继续”时一样。
有什么方法可以在发生错误时停止执行脚本并显示错误对话框?
谢谢!
最佳答案
是的,您可以这样做。但是每次您需要检查错误号时,也就是使用err.Number和err.Description时,您可以获得运行时错误的详细信息。
例如:
Function abc()
on error resume Next
..
msgbox err.Number,,err.description
End Function
关于vbscript - 使用QTP的自动化对象模型时,有什么方法可以显示QTP运行时的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5976257/