Forum Discussion

ringraham's avatar
ringraham
Contributor
10 years ago

Handle to main window different between TestComplete and TextExecute

When building our scripts, I use the following to get to the main window of our app in TestComplete:

 

TestedApps.OurApp.Run();

ourApp = Aliases.OurApp;

hwndSource = ourApp.HwndSource_MainWindow2;

 

Running this script in TestComplete works on multiple machines. Note that ourApp.HwndSource_MainWindow appears to be to a dialog box, just in case anyone was curious why it is MainWindow2.

However, when I try to run these same scripts through TestExecute, I receive a runtime error indicating:

 

'HwndSource_MainWindow2' is null or not an object.

 

I did notice that we are running TestComplete 10.6 and our TestExecute version is 10.3. I wouldn't think this would be the issue, but we are currently downloading and transferring the executable to our dev network to see if this might be the problem. In the meantime, I wanted to see if anyone else had any input on why the windows handles might be different between the two apps.

 

Thanks.

 

-Ron

  • For anyone that might experience this, it turns out that, YES, it was due to trying to run the script created with TestComplete 10.6 using a 10.3 TestExecute. Once we installed the 10.6 TestExecute, the scripts ran fine.

  • For anyone that might experience this, it turns out that, YES, it was due to trying to run the script created with TestComplete 10.6 using a 10.3 TestExecute. Once we installed the 10.6 TestExecute, the scripts ran fine.