Forum Discussion
ArtemS
Alumni
14 years agoHi Håkan,
I've reproduced your problem with passing functions as parameters. We'll investigate it as well.
Meanwhile, you can use the following workaround - wrap the callback functions into helper functions and call them instead.
That is, instead of passing a function declaration to the TestComplete engine:
Item = Script.JSFunction("param1", function() {...})
you need to create a wrapper for the callback function in the web-page script:
JSFunctionWrapper(param1) { JSFunction(param1, function() {...})}
and invoke this wrapper from TestComplete:
Item = JSFunctionWrapper("param1");
I hope this helps.
I've reproduced your problem with passing functions as parameters. We'll investigate it as well.
Meanwhile, you can use the following workaround - wrap the callback functions into helper functions and call them instead.
That is, instead of passing a function declaration to the TestComplete engine:
Item = Script.JSFunction("param1", function() {...})
you need to create a wrapper for the callback function in the web-page script:
JSFunctionWrapper(param1) { JSFunction(param1, function() {...})}
and invoke this wrapper from TestComplete:
Item = JSFunctionWrapper("param1");
I hope this helps.