Consistent error on build machine

Mar 28, 2008 at 2:36 PM
Hey,

We're having trouble getting White to successfully get our application window once the application has been started, the error we're getting is:
---
Core.UIItems.UIActionException : Couldn't find window with title i2.Ngdtp.Main in process 4016, after waiting for 5000 ms Name: i2.Ngdtp.Main.exe, Bounds: 171,128,683,512 ProcessId: 4016 Name: CCTray , Bounds: 110,242,902,467 ProcessId: 2348 Name: CruiseControl.NET, Bounds: 88,116,669,518 ProcessId: 3220
at Core.Factory.WindowFactory.<>c_DisplayClass3.<WaitTillFound>b_1() in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 37
at Bricks.Core.Clock.Perform(Do do, Matched matched, Expired expired) in D:\bricks\Bricks\Core\Clock.cs:line 44
at Core.Factory.WindowFactory.WaitTillFound(Do find, String message) in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 38
at Core.Factory.WindowFactory.FindWindowElement(Process process, String title) in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 47
at Core.Factory.WindowFactory.CreateWindow(String title, Process process, InitializeOption option, WindowSession windowSession) in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 103
at Core.Application.GetWindow(String title, InitializeOption option) in c:\cruisecontrolrb\projects\white\work\Core\Application.cs:line 128
---

I understand that its the GetWindow thats consistently failing but I am 100% positive that the application window is actually there when the Core.Application.GetWindow is called.

Is anyone else getting similar problems?
Does anyone have any suggestions for us to try?

Thanks,

James.
Coordinator
Mar 28, 2008 at 7:03 PM
Looking from the error message it seems like the window title is "i2.Ngdtp.Main.exe" while you are looking for "i2.Ngdtp.Main"
Mar 31, 2008 at 2:20 PM


viveksingh wrote:
Looking from the error message it seems like the window title is "i2.Ngdtp.Main.exe" while you are looking for "i2.Ngdtp.Main"


Thanks for that, we've now resolved that problem but we're still getting the following intermittant failure:

---
Core.UIItems.UIActionException : Couldn't find window with SearchCriteria Name=i2.Ngdtp.Main.exe in process 1608, after waiting for 5000 ms Name: Windows Task Manager, Bounds: -32000,-32000,160,31 ProcessId: 168
at Core.Factory.WindowFactory.<>c_DisplayClass3.<WaitTillFound>b_1() in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 37
at Bricks.Core.Clock.Perform(Do do, Matched matched, Expired expired) in D:\bricks\Bricks\Core\Clock.cs:line 44
at Core.Factory.WindowFactory.WaitTillFound(Do find, String message) in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 38
at Core.Factory.WindowFactory.CreateWindow(SearchCriteria searchCriteria, Process process, InitializeOption option, WindowSession windowSession) in c:\cruisecontrolrb\projects\white\work\Core\Factory\WindowFactory.cs:line 113
at Core.Application.GetWindow(SearchCriteria searchCriteria, InitializeOption initializeOption) in c:\cruisecontrolrb\projects\white\work\Core\Application.cs:line 140
at i2.Ngdtp.Test.NUnit.UIAutomation.Helpers.ApplicationRunner.StartApplication() in C:\NgdtWorkspaces\Continuous\NGDTTeamB\Development\Test\UIAutomation\Helpers\Application\ApplicationRunner.cs:line 125
at i2.Ngdtp.Test.NUnit.UIAutomation.Tests.ApplicationTests.Init() in C:\NgdtWorkspaces\Continuous\NGDTTeamB\Development\Test\UIAutomation\Tests\ApplicationTests.cs:line 18
at i2.Ngdtp.Test.NUnit.UIAutomation.Tests.ApplicationTests.RepeatApplicationButtonDoubleClickAndApplicationStartUp50Times() in C:\NgdtWorkspaces\Continuous\NGDTTeamB\Development\Test\UIAutomation\Tests\ApplicationTests.cs:line 81
---

The above is very strange because when the error occurs I am sure the Window its looking for is actually there; one thing we'd like to be able to try is to extend the 5000ms wait time; how do we do this?

Do you have any other advice forus in this case?

Thanks,

James.

Coordinator
Mar 31, 2008 at 5:23 PM
Edited Mar 31, 2008 at 5:26 PM
You need to set the BusyTimeout value to appropriate value. It is mentioned in the Configuration section.
Apr 1, 2008 at 8:56 AM


viveksingh wrote:
You need to set the BusyTimeout value to appropriate value. It is mentioned in the Configuration section.


I saw the section on configuration, but its not very clear on where the AppConfig file goes.

You include the AppConfig file in the Core solution in the shipped source code but its not included in the Binaries you distribute. Does this mean to use the configuration file I have to change the values inside the Core solution and rebuild Core or do I take the AppConfig file out of the Core solution and place it in my solution?

Thanks,

James.
Coordinator
Apr 1, 2008 at 12:01 PM
App.Config are standard ways in which you define settings for the dll or exe.
White assumes defaults values if these are not configured.
You can create your own App.config and add white-core sections in them.
Apr 1, 2008 at 5:50 PM
I think we got to the bottom of our problems with this; we have found that it was necssary for us to do some checking on the responding state on the process for our application under test. We found that if we didnt do this then White would often try and get the Window from the Application before it was in a state to return the process.

In order for us to do this we had to get the process (a System.Diagnostics.Process object) outside of white and then check the state of this process (Process.Responding / Process.Refresh).

Would it be possible for you expose Process.Responding / Process.Refresh on the White Application object so we dont have to do this outside of White?
Thanks,

James.