As I mentioned in my previous post “UI Automation/Accessibility in Silverlight 2, tools and resources summary”, UIA Verify is one of the current options for UI Automation testing of controls and applications. The tool was published by the Microsoft UI Automation team about 7 months ago and according to the release page, it was downloaded about thousand of times so far. Still, I didn’t find any public articles regarding its advantages not because the tool is useless, quite the opposite! So I decided to describe the tool’s features briefly and I hope you’ll enjoy the tutorial.

First of all, please note that UIA Verify supports WPF as well as Silverlight! This is a huge advantage for us @Telerik as our purpose is to provide complete UI Automation support both for RadControls for WPF and RadControls for Silverlight!

Next, UIA Verify comes with intuitive GUI. Should you run the executable, you see the picture below:

 

UIAVerify_Initial

 

The windows tree is represented to the left. You can browse through the windows and the elements selecting those you’d like to test or you can switch the “Hover Mode” on:

 

HoverMode

As you can see from the modes, one can put Visual UIA Verify always on top and use the focus tracking option for the element in interest. Also, there are some modes of highlighting the element plus an easy navigation through the tree of elements.

Now I’m running our latest Silverlight 2 Release Candidate live demos. I load the demos of RadNumericUpDown, one of the first Silverlight components provided with UI Automation support. After I have focused it I hold CTRL and get it selected in UIA Verify tree (with the help of the “Hover Mode” option). The selected element is an editable input and its parent, the actual NumericUpDown control, is recognized as Spinner. So far, so good!

Let’s take a look at the element’s automation properties. The right panel in the UI gives you all the information regarding the UI Automation support of the element:

SpinnerProperties

So our NumericUpDown is recognized through its automation ID; it is focusable via the keyboard; it has the corresponding class name; it has ControlType.Spinner type set, etc. Yes, this is the same information one can get with the help of UI Spy that I mentioned in my list of tools summary posted a week ago.

The Patterns section shows that our control implements the RangeValuePattern as expected. I expand the tree to check the values of the pattern members. Additionally, I run the SetValue method to see whether the NumericUpDown’s value can be set. I successfully get the new value straight into the demo:

 

SetValue_RangeValuePattern

Now let’s focus on the automated tests that are a part of UIA Verify. The tool comes with a base of tests for each automated element! Those are grouped by priority as you can see from the screen shot. There are tests specific to each UI Automation control type as well as some concerning the pattern. You can either run all the tests for this element, control type and pattern, or execute some specific tests:

RunSpecificTests 

Before running all the tests for our NumericUpDown control, I recommend turning on the “Always on top” mode. This way you’ll have the tool always visible no matter which window is focused during the test execution for example. Running the tests opens a new window representing the progress:

 

TestsRunning

Finally, we get our Overall test results:

 

OverallTestResults

The table is clear. Those links to the left load all the passed, failed and the caused unexpected error tests. The failed ones are documented so one can follow the test output. Those two tests fail because of AutomationId duplication along with improperly labeled input:

 

FailedTest

Okaaay, I have to report the issues now. Thanks, UIA Verify!


Related Posts

Comments