Thondorin --> Truying to understand

Jul 5, 2012 at 11:53 AM

Hey!

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 2:24 PM

Hi

 

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?

 

Throndorin

Jul 6, 2012 at 8: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 9:33 AM
Edited Jul 6, 2012 at 9:33 AM

Hi

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.

 

Throndorin