Working for Windows application as well..... :) but with some modifications.

Developer
Dec 14, 2012 at 6:38 AM

1) Generic type in Find methods in UITestControl Extension class to be of type UITestControl rather than HtmlControl.

2)Have a Protected variable say "Window" of type ApplicationUnderTest in Page class. This will hold reference of Window application.

3)Have a Launch method within Page class which will call ApplicationUnderTest.Launch(path) and set page.Window to its returned handle.

4) That's All.... Use Window now instead of Browser. See Example below for Calculator.

 Window.Find<WinButton>(new { Name = "8" }).Click();
Window.Find<WinButton>(new { Name = "Multiply" }).Click();
Window.Find<WinButton>(new { Name = "5" }).Click();
Window.Find<WinButton>(new { Name = "Equals" }).Click();