Contributions
Re: Cross-Unit JScript Exceptions
To continue this though, it seems like sometimes exception handling will work across multiple units for instance, if I did the following: Unit A: //USEUNIT UnitB function main(){ try{ doSomething(); }catch(e){ Log.Message(e.description) } } Unit B: function doSomething(func){ throw new Error("Test"); } The error is caught properly again. The exception is thrown across the script unit boundary but still gets caught. So I was wondering what exactly gets caught between scripts and what does not1.6KViews0likes1CommentRe: Cross-Unit JScript Exceptions
Possibly. What exactly do you mean by a scoping thing though? For instance, if I put the original codefor doSomething() in UnitA, the Exception handling works properly. Unfortunately, this kind of external exception catching is necessary to what we're trying to create. We're looking to create a "try" concept for TestComplete Errors. We have that part working so that you can pass a function and any TC logged errors will be deffered to warnings (and then accessed in a "catch" function) but unfortunately, it does not work with JS exceptions since they cannot currently be caught in the way I showed. They also are not handled as normal TC Errors which makes things trickier.1.6KViews0likes0CommentsCross-Unit JScript Exceptions
I read in the SmartBear documentation here: Handling Exceptions in Scriptsthat TestComplete handles cross-unit exceptions in JScript except in certain cases. I followed another link toJScript Specificsand found that TestComplete cannot handle script exceptions thrown from a method of an object created in another Script Unit. I have the following case which does not meet that criteria but still isn't working: Unit A //USEUNIT UnitB function main(){ doSomething(function(){ throw new Error("Test"); }); } Unit B function doSomething(func){ try{ func.apply(null,[]); }catch(e){ Log.Message(e.description) } } Since that does not fall under the category mentioned, it seems like this kind of thing should work. I get that it's kind of a weird construct. But it would be handy in our project if this kind of thing could work properly. Does anyone know in which cases cross-unit exceptions can be caught properly?1.6KViews0likes6CommentsTestComplete Crashes when debugging Keyword Tests
I am using JScript with my project and I have found that if one of my scripts returns a JScript object while I am debugging a Keyword test, TestComplete will freeze. The only option to recover is to kill the process and restart. This happens every time and makes debugging very difficult. To reproduce, try including the following in a JScript Script Unit and calling the function showFreeze from a Keyword Test. Store the return value to a variable and step once more (to a log statement or something) so the variable would be showing in the Local Variables window. TestComplete will freeze. I have also included an example project that shows this behavior. function showFreeze(){ return new Example(); } function Example(){ this.message = "Hello"; }1.1KViews0likes2Comments