I get an erroneous "Cross references are not allowed." message
I have two JavaScript files - Main_TrussStudio and DesignTrusses1A. When I attempt to run the test from the Main script file the script view jumps to the DesignTrusses1A file and presents an error dialog with the following content:
Syntax error(s).
The units DesignTrusses1A and Main_TrussStudio refer to each other.
Cross references are not allowed in JScript units.
Error location:
Unit: "CSAutomation\CSDirector\Script\DesignTrusses1A"
Line: 2 Column: 1.
The error is bogus/erroneous because DesignTrusses1A script unit does not contain any USEUNIT reference to the Main_TrussStudio script unit. The referenced line is:
//USEUNIT ToolbarFunctions_TSLayout
Which is obviously not "//USEUNIT Main_TrussStudio" as implied.
Has anyone seen this before or know a way I can work around it? I am using TestComplete 11.31.2420.7.
Nope, still doesn't answer my question.
Open up the script file ToolbarFunctions_TSLayout
What USEUNIT statements, if any, are in that file. Circular references are chained in. So, even if Main is not DIRECTLY mentioned in DesignTrusses1A, if there is a reference to Main in ToolbarFunctions_TSSLayout, that may generate the error as well.
So... basically, go down the line and examine ALL your code units and make sure that NONE of them reference back to your Main unit.