timeout issues

Jan 16, 2009 at 4:12 PM
Edited Jan 16, 2009 at 4:18 PM

I am getting the following TimeOut error when running an NUNIT test using White ,

Core.UIItems.UIActionException : Couldn't find window with SearchCriteria AutomationId=CATMainWindow in process 3132, after waiting for 5000 ms

The error seems to be happening (i think) here, on this line in my code (when opening a wpf window).

Core.UIItems.WindowItems.WPFWindow wpfWindow = (Core.UIItems.WindowItems.WPFWindow)
application.GetWindow(sc, Core.Factory.
InitializeOption.NoCache); //"CAT 3.0"



... when getting the window.

Here's the page for setting up the configuration (click).  What configuration setting is it that i should set?
I partially solved it by setting the configuration with the following:

           <add key="BusyTimeout" value="30000" />
           <add key="UIAutomationZeroWindowBugTimeout" value="30000" />

Pls confirm whether the above is enough.

I am also getting exceptions that are cause by my slow UI.

For example i have a Tree control representing directortories on my Harddisk.
If i click a node (a directory).   I expect the node to open, and  (it does so dynamically) showing nodes for the contained items in the node (like other directories).

But the UI does not manage to expand the node so fast. 
And my code races ahead to open a (sub)node, expecting the expansion - when in fact it didnt happen.

How can i via whites UIA click a node and wait to be sure that the node is expanded?

Paul S.

Jan 16, 2009 at 10:05 PM
Changing the timeouts is the best solution that I've seen for the Window timeout errors.

As for the dynamic Tree control, try using the WaitTill method on the Window class to check against a visual condition (such as the visibility of the subnode) after clicking the parent node, before moving on.
Jan 19, 2009 at 9:24 AM
thanks.. will do,

could you or someone else at white, tell me how to get to a textbox that is within a combo box?  I also put the question in a separate discussion email.

the combox box functions essentially as an expander (but it isnt :-)).
clicking on it works but as soon as control goes back from the gui to the next code line in the automation test ... whoopsie the combobox closes.

i actually do see to get a reference to the textbox but putting text into it seems not to really work.

Jan 29, 2009 at 10:43 AM
Solved:  by clicking the ComboBox... the VisualTree is updated   ... i then use the KeyIn and Mouse.Click() methods.
More concretely i do:

//*** comboForDateTimePicker
//Search for Part Year
Core.UIItems.Finders.SearchCriteria scForDTCombo =
Core.UIItems.ListBoxItems.WPFComboBox dtCombo =
Assert.IsNotNull(dtCombo, "Couldnt locate the combo box in the date picker.");

Core.UIItems.Finders.SearchCriteria scPartYear =
Core.UIItems.IUIItem iuItemForpartYearTB = wpfWindow.Get(scPartYear);
Assert.IsNotNull(iuItemForpartYearTB, "Couldnt locate the year text box.");
Core.UIItems.TextBox partYearTB = (Core.UIItems.TextBox)iuItemForpartYearTB;
partYearTB.BulkText = "2001";