chadm_1
14 years agoNew Contributor
Is it possible to debug on runtime error?
I was wondering if anyone could give me a definitive answer as to whether or not it SHOULD be possible to debug a script after a runtime error.
The easiest way of replicating what I mean is to write a few lines of code that forces a divide by 0:
Function TestDebug()
Dim intNum1, intNum2, dblResult
intNum1 = 5
intNum2 = 0
dblResult = intNum1 / intNum2
End Function
If I run this, it gives a VBScript runtime error popup. However, this popup only has an OK button, which when clicked completely stops the script execution. I need to know if there's any way to get TestComplete to allow you to debug from the current line that threw the error so you can figure out exactly why it had the error.
I realize you can stop the test run, put a breakpoint on a line right before where the error occurred, and run to the breakpoint on a 2nd execution. However, this is not always a viable option because in our systems there is a lot of non-user-entered data that effects our test cases that changes from run to run (stock prices, etc), so there's no guarantee the error will happen again on the next rerun.
In the project properties, on the Playback section, there is the "Error Dialog" checkbox. The description for this checkbox states "If this option is enabled, TestComplete will ask whether to stop the test run on critical errors". If this is unchecked and I run the example above it just stops execution without throwing the runtime exception popup. The fact that it says "ask whether..." implies to me that it should somehow be possible to debug in these cases.
Any advise/input would be appreciated.
The easiest way of replicating what I mean is to write a few lines of code that forces a divide by 0:
Function TestDebug()
Dim intNum1, intNum2, dblResult
intNum1 = 5
intNum2 = 0
dblResult = intNum1 / intNum2
End Function
If I run this, it gives a VBScript runtime error popup. However, this popup only has an OK button, which when clicked completely stops the script execution. I need to know if there's any way to get TestComplete to allow you to debug from the current line that threw the error so you can figure out exactly why it had the error.
I realize you can stop the test run, put a breakpoint on a line right before where the error occurred, and run to the breakpoint on a 2nd execution. However, this is not always a viable option because in our systems there is a lot of non-user-entered data that effects our test cases that changes from run to run (stock prices, etc), so there's no guarantee the error will happen again on the next rerun.
In the project properties, on the Playback section, there is the "Error Dialog" checkbox. The description for this checkbox states "If this option is enabled, TestComplete will ask whether to stop the test run on critical errors". If this is unchecked and I run the example above it just stops execution without throwing the runtime exception popup. The fact that it says "ask whether..." implies to me that it should somehow be possible to debug in these cases.
Any advise/input would be appreciated.