Unable to get the reference of button object

Oct 23, 2010 at 7:54 PM


we're new to white, and we're trying to build a test framework for our product using white.

We're trying to wrap the 'Button' class by extending it. The 'wrapped button' is in a container, when we call the Get<> method on the container to obtain the reference of the button object, it is returning null.

Our code looks like this -

MyButton mButton = Panel.Get<MyButton>(SearchCriteria.ByAutomationID("OK"));


How do we go about this?


Thanks in advance,






Oct 23, 2010 at 10:39 PM



why do you wrap the button class?


and how do you wrapp it?



Oct 24, 2010 at 2:42 AM


The extension of the button class was just an example. We would find more use in extending classes of the type container, like Panel or the window. The reason that we are interested in wrapping the container classes would be to enhance the get functionality.

If we could do this, our framework would become much easier to use.


MyPanel panel = window.get<MyPanel>(SearchCriteria.ByAutomationId("name of the panel"));

Button button = panel.GetButton("buttonName");

The panel, if it could have some functions specific to our application, it would ease out a great deal of effort.



Oct 24, 2010 at 7:55 AM

I know what you mean.

I have wrapped most windows too, but don't use a overwritten class.

You should have a look in the real implementation of UIItem to understand how Get works

I think viveksingh should, answer this if you don't found answer in code.



Oct 25, 2010 at 9:19 AM

Hi Throndorin,

We followed your suggestion and we didn't have to compromise on anything until now. Thanks :)