Hi Ryan,
As far as I understand, TestComplete works correctly in this situation. The app form is loaded longer than TestComplete is waiting for it. Try using the following code to get the application's main form:
[JScript]
function getMainForm(timeout)
{
// Default timeout is 60 seconds
if (null == timeout) timeout = 60000;
var proc = Sys.Process("Infinity");
var mainForm = Utils.CreateStubObject();
var oldTimeout = Options.OpenApps.InvokeTimeout;
var endTime = GetTickCount() + timeout;
while (GetTickCount() < endTime) {
mainForm = proc.WaitWinFormsObject("frmCATFRAMS", 0);
if (true == mainForm.Exists) break;
Delay(200);
// This line resets the object tree
Options.OpenApps.InvokeTimeout = Options.OpenApps.InvokeTimeout + 1;
}
Options.OpenApps.InvokeTimeout = oldTimeout;
if (false == mainForm.Exists) {
Log.Warning("Unable to get the main form object.");
}
return mainForm;
}
The VBScript version of this sample is located http://smartbear.com/forums/f81/fp6/t74310/incorrect-object-names.