This project is read-only.

Thondorin --> Truying to understand

Jul 5, 2012 at 12:53 PM


I have used UI Spy work myself down in the client im working with, buried deep within panels and other controls rests an EDIT control, I have checked the mapping and it's a textbox so thats cool.

Is there anyway I can work myself down through this structure... using White?

Or how should i tackle this problem?

AutomationID is same for all four textboxes, there is a localized controltype, name is empty though I now the name from debugging in runtime. How should i go about to let white enter data into the textbox?


Jul 5, 2012 at 3:24 PM



in general it is an good idea to get all visible elements in the tree starting from the top (the window in most cases).

has all Textboxes the same parent?



Jul 6, 2012 at 9:34 AM

Okay I think I grasped everything now. We have a very complex tree structure buidling up our surface. Thing is that on the lowest lvl  our dynamicly created textbxoes have the same automationID, so in order to get the correct one I have to grab the correct textbox by going backwards in the tree structure.

IUIItem item8 = win2.Get(SearchCriteria.ByAutomationId("BRANCHWITHCORRECTTEXTBOXIN"));

So far so good then I perform a and here's the return type AutomationElement?? Which in turn does not have the functions fo enter(), click(). How should I go about to enter data into the textbox?

AutomationElement correcttextbox = item8.GetElement(SearchCriteria.ByAutomationId("Txt_TextBox")); 

Jul 6, 2012 at 10:33 AM
Edited Jul 6, 2012 at 10:33 AM


some possible solutions/ideas:

if the application under test is WPF:

using White.Core.UIItems.WPFUIItems;

now Get<> and Get is available on each White Item

you can also create a TextBox (or other White elements)


AutomationElement correcttextbox = item8.GetElement(SearchCriteria.ByAutomationId("Txt_TextBox"));

Textbox box = new TextBox(correcttextbox, item8.ActionListener);


Hope that helps.