QTP Web Extensibilty – How to force QTP to stop test execution

qtpweb-extensibility

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?

Best Answer

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);
Related Topic