Position Based Searching - more info needed

Jul 17, 2008 at 2:42 AM
Hi...first off, thanks for this! Really a nice implementation...

My question: I have small GUI, but it seems to take a while for White to find my UIItems. I tried speeding it up using the position based searching, but I don't notice any speed increase.

So, two questions:

1) The documentation indicated there was an XML file that would be created. I can't seem to find this. I created an App.config file, but I don't see any XML file anywhere. Is there something else I have to do to initialize things?
2) I think there is a bug in the doc. It says you should add a line like this: 

Window window = application.GetWindow("Customer - Foo", InitializeOption.NoCache.AndIdentifiedBy("Customer"));

That errored for me. I changed it to:


Window window = application.GetWindow("Customer - Foo", Core.Factory.InitializeOption.NoCache.AndIdentifiedBy("Customer")); and that seemed OK.


I was unclear about the arguments though I assume that Customer - Foo is the exact name of the window title, and Customer is just my storage name (and could be anything) Is this right?
Jul 20, 2008 at 12:15 PM
Sorry for not getting back earlier on this.
The documentation was incomplete, for this. I have changed it.

You also need to do application.ApplicationSession.Save() at the end of the test (or after killing the application).

This would should create the xml file.
Oct 11, 2008 at 9:22 PM
How do I get the controls for a modal window included in the position based cache in the xml file?  My main window controls are included by those on the modal sub windows are not. 

For the main window I'm doing:

oWin = moCurrentApplication.GetWindow(



For the modal dialog I'm doing:

oWin = moCurrentWindow.ModalWindow(

"Confirm Assessment", InitializeOption.NoCache.AndIdentifiedBy("frmEForm3"));

The xml file named "frmEForm3.xml" shown below only contains the single field on the main window "testDirector" which I accessed but doesn't appear to include any of the fields I've accessed on the modal window. 

<Core.ScreenMap.WindowItemsMap assembly="Core, Version=, Culture=neutral, PublicKeyToken=null"><fileLocation>.\frmEForm3.xml</fileLocation><dirty null="True" /><loadedFromFile null="True" /><lastWindowPosition><_x>320</_x><_y>0</_y></lastWindowPosition><currentWindowPosition null="True" /><_items><Core.ScreenMap.UIItemLocation assembly="Core, Version=, Culture=neutral, PublicKeyToken=null"><point><_x>332</_x><_y>129</_y></point><searchCriteria><conditions><_items><Core.UIItems.Finders.ControlTypeCondition assembly="Core, Version=, Culture=neutral, PublicKeyToken=null"><controlType>50004</controlType></Core.UIItems.Finders.ControlTypeCondition><Core.UIItems.Finders.AutomationIdCondition assembly="Core, Version=, Culture=neutral, PublicKeyToken=null"><identification>testDirector</identification></Core.UIItems.Finders.AutomationIdCondition><null /><null /></_items><_size>2</_size><_version>2</_version><_syncRoot null="True" /></conditions><indexCondition><index>-1</index></indexCondition><customItemType null="True" /></searchCriteria></Core.ScreenMap.UIItemLocation><null /><null /><null /></_items><_size>1</_size><_version>3</_version><_syncRoot null="True" /></Core.ScreenMap.WindowItemsMap>


Oct 12, 2008 at 4:43 AM
Seems like since I had made a call to GetWindows() before the GetWindow and ModalWindow that this was preventing the modal windows position information from being written to the xml file.  Is this correct?  I'm still interested if the code from my previous post is the best way to get the modal windows info into the XML file.


Oct 15, 2008 at 5:53 AM
When you are finding the ModalWindow:

oWin = moCurrentWindow.ModalWindow("Confirm Assessment", InitializeOption.NoCache.AndIdentifiedBy("frmEForm3"));

You need to provide different identification for the window.
White stores the information about the UIItem's position in a file so that next time it can fetch based on position which is much faster. This file name has to be unique for which the user needs
to provide the identification.

Let me know if it doesn't work with this as well.
Oct 16, 2008 at 12:02 PM
It's working.  But there seems to be some kind of interaction between having made a GetWindows() call and then making a GetWindow() call.  The GetWindow() call doesn't find the window after calling GetWindows() but does if I comment out the GetWindows() call?

Even with position-based searching working the speed of sending test to a textbox control still seems too slow.  Should simply sending the text or reading the text be very fast?  If I send a string of 50-75 characters to a text box I can see groups of characters appearing in the text box with what appears to be slight delays, reading text also seems to delay for fractions of a second.  What I would expect is that I could make the automation run fast.  Can you say anything about how fast writing and reading to a text box should be?
Oct 18, 2008 at 5:45 PM
Please use BulkText method for entering data quickly in text fields. This would not fire any events though at end of every character input.
I would look into GetWindows thing.