Reputation: 1059
I'm implementing an extension to QTP using the Web Extensibility Toolkit. If my JScript function that implements the QTP action encounters an error (e.g User gave wrong argument values), I want the QTP to stop the test execution and notify the user about the error. I want it to act as a normal error in QTP and ask if the user want to debug\retry\skip\stop execution.
How can I do it?
Upvotes: 3
Views: 4246
Reputation: 114695
If you throw an exception with a string then the message you throw is presented in QTP like any other script error (StopRetrySkipDebug)
You should throw a JavaScript Error
object so that QTP will be able to display a meaningful message:
throw Error("I'm sorry, Dave. I'm afraid I can't do " + action);
Upvotes: 1