Forum Discussion
hlalumiere
13 years agoRegular Contributor
There are a few things I came across as problematic while converting our application's test project from 8.2 to 9. Because the existing codebase never used name mappings, we decided to take the opportunity to review the entire codebase, optimize time intensive routines, eliminate stale and repetitive code etc, since we already had to go through it to update the object mappings.
Some constructs that worked fine in TC8.2 now cause issues. For example:
Do While WaitForm(GetMainProcess, "FExtendedProgress", DELAY_WAITFORM).Exists
...
Loop
WaitForm is just an adapted .FindAllChildren and auto-maximize, GetMainProcess returns a reference to the application process, and DELAY_WAITFORM = 5000.
This now eventually in a long loop fails with different non-sensical errors like "The window is disabled." or "The window was destroyed during method executions", etc... Of course it's not excellent code, but the point is this was working. Now after revision it looks like this:
Set FExtendedProgress = WaitForm(GetMainProcess, "FExtendedProgress", DELAY_WAITFORM)
Do While FExtendedProgress.Exists
...
Loop
And works fine. Point is there is no heads or tails as to what is causing the original implementation to fail in TC9, but it is clear from the solution implemented that repeatedly calling FindAllChildren is the culprit here. Since I installed the 1312 patch and revised some code, the 15% we have converted performs very well, in many cases faster than TC8.2, but there is still that annoying occasional pause where TC seems to be looking for a window it should see right away. I am hoping this will get isolated and fixed soon. If you have a large project, you should ideally keep 8.x running for production, and setup a separate machine with the 9.0 version of your project on to experiment and benchmark. There will be code to change, and hoops to jump through, no matter what the official notes say, but once it is done I bet the TC9 version of your project will be faster than 8.2.
Some constructs that worked fine in TC8.2 now cause issues. For example:
Do While WaitForm(GetMainProcess, "FExtendedProgress", DELAY_WAITFORM).Exists
...
Loop
WaitForm is just an adapted .FindAllChildren and auto-maximize, GetMainProcess returns a reference to the application process, and DELAY_WAITFORM = 5000.
This now eventually in a long loop fails with different non-sensical errors like "The window is disabled." or "The window was destroyed during method executions", etc... Of course it's not excellent code, but the point is this was working. Now after revision it looks like this:
Set FExtendedProgress = WaitForm(GetMainProcess, "FExtendedProgress", DELAY_WAITFORM)
Do While FExtendedProgress.Exists
...
Loop
And works fine. Point is there is no heads or tails as to what is causing the original implementation to fail in TC9, but it is clear from the solution implemented that repeatedly calling FindAllChildren is the culprit here. Since I installed the 1312 patch and revised some code, the 15% we have converted performs very well, in many cases faster than TC8.2, but there is still that annoying occasional pause where TC seems to be looking for a window it should see right away. I am hoping this will get isolated and fixed soon. If you have a large project, you should ideally keep 8.x running for production, and setup a separate machine with the 9.0 version of your project on to experiment and benchmark. There will be code to change, and hoops to jump through, no matter what the official notes say, but once it is done I bet the TC9 version of your project will be faster than 8.2.