简体   繁体   中英

Is there is any way to show error during runtime in QTP when using QTP's Automation Object Model

I'm using QTP Automation Object Model to run tests:

Set qtpObj = CreateObject("QuickTest.Application") 'Creates an instance of the QTP

BUt in that mode QTP doesn't show any error dialogs (with Stop, skip, debug buttons), like it behaves with On Error Resume Next. Is there any way to stop execution of the script when error occurred and show the error dialog?

Thank you!

yes you can do that.. But everytime you need to check the error number ... ie using err.Number & err.Description you can get the run time error details. Eg:

Function abc()
  on error resume Next
  ..
  msgbox err.Number,,err.description
End Function

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM