Forum Discussion
Alexei,
Can you comment .Net initialization part? Does it occur when the test execution is started or at some other moment of time? Does it occur once for the whole test project or every time when the execution of test item is started during the test run?
Initialization occurs for the project at the moment when TestComplete "accesses" the CLR Bridge for the first time. After this, .NET is not re-initialized during the test item execution. The inter-process penalties (marshalling, conversion) occur on each script line. Else, it would be impossible to call methods and properties.
You are right that the "scripting" approach works faster than the ".NET-bridge" approach. I didn't have a chance to conduct thorough experiments, I just ran quick rough tests (getting two color values, comparing and outputting results). In these tests, the "scripting" solution worked about 2-5 times faster than the approach that involves using .NET classes. However, in my opinion, in absolute values the difference was not very large (e.g. ~17 s vs. ~4 s for 1,000 calls).
The .NET Color object contains special methods which QA engineers may want to use further in their tests. So, I think the ".NET-bridge" approach is also acceptable in certain situations.