Telerik blogs

The purpose of this post is to summarize the tools and resources for UI Automation/Accessibility testing in Silverlight 2 available at the present moment as well as to share a few details on what’s expected in the nearest future. There are a lot of resources on the web about Microsoft UI Automation framework and Active Accessibility so I’m not going to put any general information here. Still, you can refer to the list at the end of the post for additional information.

The UI Automation testing tools are quite important to developers and testers (like me) that are interested in Silverlight/WPF test and UI automation. Let me start with the UI Spy, a part of the Microsoft Windows SDK, which displays the UI Automation characteristics of the elements on each window in a tree view. The image below shows a typical view from UI Spy over Silverlight page. I’ve put RadSlider there to look at its UI Automation properties (please note that’s RadSlider for Silverlight 2 RTW update we announced last week):

 

RadSlider in UI Spy

 

UI Spy allows easy search for the exact element of interest by just hovering the control on the page and holding CTRL key. You can also locate the element on the demo by enabling the location option (the tool surrounds your element with red boundaries as shown in the picture). Additionally, read about the Spy tasks on MSDN. You might be also interested in what Tamir Khason shared about UI Spy and Accessibility in WPF some months ago.

UI Spy can be used in conjunction with advanced UI Automation testing tools like White. The project is available on CodePlex. White provides rich API based on UI Automation and supports Win32, Windows Forms, WPF and SWT (Java) based applications. In the latest version labeled 0.17, White does not support Silverlight (how could that be?!), but that is scheduled for the next release, which can come up in a few weeks. I will prepare another post concerning the RadControls for Silverlight 2 UI Automation testing via UI Spy and White as soon as I’m able to test the SL extension of White.

Back in March 2008, the MS UI Automation team posted their testing framework on CodePlex as well. It is called UI Automation Verify (UIA Verify) and comes with a complete test library and GUI tool. There are built-in automation element and control tests, and I’m also excited about the option of extending the available test library. Needless to say, the testing framework usability is enormously increased by that option! I’m looking forward to getting more details about the framework and having some experience to share on this blog.

Let’s move ahead to the MSAA tools. You can find some available ones as Active Accessibility 2.0 SDK Tools Event Watcher, Accessibility Explorer and Inspect Objects. Find the bits for free download here.

Along with the UIA Verify framework mentioned above, Microsoft published their UI Accessibility Checker (AccChecker) on CodePlex. AccChecker comes with GUI tool, API for the test case creation as well as a “Screen Reader” feature, which can catch the UI’s programmatic access if broken. Hmm, does “AccChecker” sound the same as “AccExplorer” for you too? Find a comparison between both tools on AccChecker threads here.

Do you want to hear (yes, to hear!) what is displayed on the screen in your Silverlight site and make sure the blind people or those with low vision can hear the expected? Use the Narrator Accessibility Speech engine of your Windows. There is an article describing Narrator as KB at support.microsoft.com. You can find the tool under Programs – Accessories – Accessibility group or you can just type “narrator” in Start – Run dialog box.

I’d like to stop here and invite your comments on the topic. Do you have a favorite tool for UI Automation or do you plan to make your Silverlight site accessible? Feel free to share your experience or impressions.

 

I’ve listed some additional resources below:

UI Automation Fundamentals

UI Automation of a Silverlight Custom Control

WPF Application Quality Guide – UI Automation Tools

Accessibility and UI Automation in Silverlight 2 by Pete Brown

Project White: Automated UI Testing by Ben Hall

Testing WPF applications with the White UI Test framework by John D'Addamio

UI Automation in Siverlight – Simulating User Interactions by Gabriel Isenberg

UI Automation in Silverlight - Part II (The Easy Way) by Gabriel Isenberg

Sara Ford WebLog’s posts on Accessibility

Accessibility Developer Center

Microsoft Accessibility Labs

AIA – Accessibility Interoperability Alliance

 

Hope this summary helps!

 

P.S. I've attached UISpy to my post so you don't have to download the whole Windows SDK update to run the tool.

UISpy.zip 

[Yours UI Automation addicted]

-Konstantin


Comments

Comments are disabled in preview mode.