Forum Discussion
I'm doing some scripting AUT methods like getModel(), getNodeArray() [this is some customized functions in AUT]. I got an exception inside try and then TC tried to log the error in catch block. Then this weird thing happend.
And also this is not happening always, Last few days i'm getting this error.
Actual error message which i got.
Error occured in driver script and Error Description: TypeError: Log.Error is not a function at fn_executemodules (<aq:Driver>:304:29) at driverscript (<aq:Driver>:168:31) 18:43:48 Normal
- tristaanogre8 years agoEsteemed Contributor
HRm... what's happening at line 304 of Driver.fn_executemodules?
Also, do you have something going on in your OnLogError event handler?
The reason why I'm asking some of this is that, in developing Script Extensions, I noticed that if you have native TestComplete functions and objects being used outside of function declarations, the JScript engine doesn't recognize them.For example, if I do something like this:
var testme = aqString.ToUpper('this is me'); function test1() { Log.Message(testme); }
this will generate a low level JavaScript error when it is executed within a script extension. So, I'm curious if you're calling a Log.Error call in a context for which the Log object is not defined? I don't have any specifics about WHERE that could be, but that seems to follow the pattern.
- shankar_r8 years agoCommunity Hero
line 304 is doing below stuffs
try { //Function to eval the string into a executable functions if the function name is availble as input string //Indicator.PushText("Execution Setup - Executing function...") eval(aqConvert.VarToStr(temparrmodules[exI])); //Indicator.Clear(); } catch(ex) { Log.Error("Error occured during evaluation of module: " + arrModules[exI]); Log.Error("Error Description: " + ex.stack); }
There are no event handlers for OnLogError, see below image
- tristaanogre8 years agoEsteemed Contributor
What does "temparmodules[exI]" evaluate as when the error occurs? That's my next suspicious point.
Also, the log text you posted a bit ago doesn't match the text in the catch line of what you posted around line 304. So, something else is bubbling up the exception being trapped by a different catch block.
Related Content
Recent Discussions
- 3 days ago