This project is read-only.

What's a good way to find a button on a panel?

Apr 1, 2010 at 1:52 PM

I got handed a WPF application that I'm attempting to build regression tests for.  I originally started with UIAutomation - but thank god for White.  Much faster, and the code is simpler.

Here's the situation:  I have a button with an AutmationID sitting on a Pane (with an AutomationID), sitting on a TabItem that IsSelected.  What's the best way to access the button to be able to select it?  I am able to get the TabItem, but I can't figure out how to retrieve the button from the pane.



Apr 1, 2010 at 2:40 PM

Use UISpy or VisualUIAVerify tool to look at  the structure / hierarchy of your WPF controls. You may need to subclass CustomUIItem to represent your custom control (

BTW, White can't be faster that UIAutomation since it's just an API wrapper around UIAutomation.


Apr 1, 2010 at 3:59 PM

I know it's a wrapper - but the response is a heck of a lot faster, than the UIAutomation code that I was writing.

But I was able to figure out - Panel is a UIItemContainer, so once I was able to get to that level, then the Get<> methods were available to me, to help speed up the search.

Apr 1, 2010 at 4:32 PM


on WPF Get<> is available on each element if you use

using White.Core.UIItems.WPFUIItems;




Apr 1, 2010 at 7:49 PM

Cool - I'll have to look into that.


Mar 14, 2011 at 10:43 PM

Treadhead, I'm wondering if you found a solution that might help me.

I can drill down as far as TabItem, but it appears I can't find any children inside it.  How did you get to your "Panel is a UIItemContainer" revelation, and how did it help you?

I'm concerned that I have the same problem as this guy:

in which case I hope I'm not out of luck.

Mar 15, 2011 at 8:41 AM


maybe Custom Commands can help you, but I haven't used them still now.

They are available since White 2.0