Container Controls

Aug 31, 2009 at 7:09 AM

Hi,

Am I understanding correctly to say that you can only search for controls from a window?

Our interface contains many tabs and tab pages or other container style controls. Do the white API support Get within containers?

Regards,

Mark

Aug 31, 2009 at 9:03 AM

Hi

mmh does this mean all your element are not part of a window???

 

tab and tabpages and many other controls can be found inside of the window (is also a Container element)

 

the normal way is

 

use Application from white

get window from application (Application.GetWindow) => you have a Window element

 

tab bla = window.Get<Tab>(SearchCriteria(ContolType.Tab).AndByAutomationId("theid"))

you can replace "Tab" with other controls like ComboBox, TabPage and so on

AndById can be replaced with AndByText for example

Throndorin

Aug 31, 2009 at 10:30 PM
Edited Aug 31, 2009 at 11:50 PM

Hi,

Yes, all elements are eventually part of a window.  I would just seem to make more sense (faster) to search within a container for a control than search the entire window .

I think the situation where we add multiple copies of the same user control is most concerning.  Will I be able to distinguish between the different copies?

Mark

Sep 1, 2009 at 6:46 AM

can you add a picture to show an example, with copies of user controls?

for my understanding a window is the root element (main window of the application)

it is also an UIItemContainer (the more abstract class)

 

Are the copies of the user controls in the same window, or new windows?

can I see the copies in the same window?

 

Throndorin

 

 

 

 

Sep 2, 2009 at 12:26 AM
Hi,
I don't know how to post pictures but what I am essentially doing is shown in the code below

SimpleUserControl c1 = new SimpleUserControl();
c1.Name = "C1";
UserControlContainer.Children.Add(c1);
SimpleUserControl c2 = new SimpleUserControl();
c2.Name = "C2";
UserControlContainer.Children.Add(c2);

SimpleUserControl is a WPF user control containing 2 lables and two text boxes.  UserControlContainer is a DockPanel

In my simple test  White works as I would expect.  If I search for  one of the TextBoxes contained within the user control by automation id then White finds the 1st instance.

If I use GetMultiple then I can see both instances.

Unfortunately, in our real application White doesn't find the controls by either technique.

Mark
Throndorin wrote:

can you add a picture to show an example, with copies of user controls?

for my understanding a window is the root element (main window of the application)

it is also an UIItemContainer (the more abstract class)

 

Are the copies of the user controls in the same window, or new windows?

can I see the copies in the same window?

 

Throndorin

 

 

 

 

 

Coordinator
Sep 4, 2009 at 4:15 AM

why donot you try window.LogStructure() in your real application