Forum Discussion
Hi rongzhong,
The syntax you need depends on the scripting language you use:
DelphiScript: see the "DelphiScript - Exception Handling" (http://www.automatedqa.com/support/viewarticle.aspx?aid=13279) help topic.
JScript: see the http://msdn.microsoft.com/en-us/library/85fscz6h(VS.85).aspx MSDN Library article.
VBScript: see the http://msdn.microsoft.com/en-us/library/sbf5ze0e(VS.85).aspx MSDN Library article.- oychwContributorAllen:
thank you very much!
I use JScript. Could JScript raise an Exception in a function and catch the Exception in an upper function (such as function 1 calls function 2.function 2 raise an Exception,and we catch the Exception in function 1).
Hi rongzhong,
The syntax you need depends on the scripting language you use:
DelphiScript: see the "DelphiScript - Exception Handling" (http://www.automatedqa.com/support/viewarticle/?aid=13279) help topic.
JScript: see the http://msdn.microsoft.com/en-us/library/85fscz6h(VS.85).aspx MSDN Library article.
VBScript: see the http://msdn.microsoft.com/en-us/library/sbf5ze0e(VS.85).aspx MSDN Library article.
Best regards,
Allen
AutomatedQA Support Team - AlexKarasChampion Level 3Hi Rongzhong,
> Could JScript raise an Exception in a function and catch the Exception in an upper function (such as function 1 calls function 2.function 2 raise an Exception,and we catch the Exception in function 1).
AFAIK this is possible only if both functions are from the same unit. Otherwise it does not work as JScript does not support cross-unit exceptions handling (i.e. this is not TestComplete's limitation but MS JScript's one). Hi Alex,
Have you tried cross-unit exception handling in TestComplete 8? :)
- AlexKarasChampion Level 3Hi Allen,
No, I haven't as I'm not using the JScript and did not see this feature mentioned in the 'What's New' at http://www.automatedqa.com/products/testcomplete/whats-new/8-0/ (probably, I should check the page one more time...).
Anyway, sorry for misleading and it's great to hear that this is possible now with JScript. - oychwContributorAlexei and Allen:
Thanks! But I am still using TC 7.5. Hi all,
Well, the feature isn't mentioned in "What's New" indeed, but it is implemented.
As for TestComplete 7, JScript exceptions cannot be handled between units in this version of TestComplete.
- tppeguContributorGood lord, nobody thought to highlight that in the What's New page? Do you have any idea how many people would upgrade for that feature alone?
Hi Tony,
Yeah, our fault. Glad to hear this feature makes your life easier :)
Related Content
- 5 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago