Forum Discussion
Andrey_M
12 years agoContributor
Sorry if my finding is not what you're looking for: I tried to implement intercepting technique for debugging which redirects control back to TC units.
at the beginning of script extension unit I defined variable
debugON = true;
at the beginning of each function I inserted line of code:
function myCode( param1, param2 )
{
if ( debugON && typeof KeywordTests == "undefined" ) return Runner.CallMethod( "myUnit.myCode", param1, param2 );
[...]
}
myUnit is name of actual unit (myUnit.js)
I check KeywordTests object to avoid endless recursion after entering into unit (this object is not available in script extensions).
If you have error specifically related to script extensions (availability of certain script extension objects etc.) this method will definitely fail.