The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Avalon - CLI307: Automated UI Testing

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Hanselman

Posts: 1031
Nickname: glucopilot
Registered: Aug, 2003

Scott Hanselman is the Chief Architect at Corillian Corporation and the Microsoft RD for Oregon.
Avalon - CLI307: Automated UI Testing Posted: Oct 29, 2003 1:24 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Scott Hanselman.
Original Post: Avalon - CLI307: Automated UI Testing
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Scott Hanselman
Latest Posts From Scott Hanselman's ComputerZen.com

Advertisement

If you've ever written a complex Windows UI you may have thought about ways to automate testing of these frameworks.  It was easier in the old days, when every control had a Window Handle that you could get ahold of.  Then more and more controls were owner draw, painted or just magic.  Regardless, automated UI testing is a hassle.

In the last few years I've been all over NUnit.  Just as my dentist says “if you don't floss, don't bother brushing,“ I say, “if you don't Unit Test, don't bother coding.“  But the exception is usually UI.

I'm in a talk on Avalon's Automated UI Testing Framework.

The Avalon UI Testing Framework appears to expose the UI components as an Object Model, that they are calling “Control Patterns” that expose the behavior of the controls.

He's brought a Command Prompt up.  He brought up the Windows Device Manager and clicked on it.

The Command Prompt then displays:

[Tree View] [Has Children]
Patterns = I:Selection

then he types “children” and the Device Manager tree expands.

The Command Prompt says:

Patterns - I:Invoke, IHierarchyItem. I:ExpandCollapse. I:SelectionItem

he also checks out a Combo Box and it says

Patterns - I:ExpandCollapse.

This means that rather than exposing the controls directly to the UI Testing code, it exposes the BEHAVIOR.  So, in OOP terms, a ComboBox and a Tree Control both implement “ExpandCollapse.”  But it's not that simplistic.  It's really about behavior.

Think about this:  If you were using a 3rd party control, you'd have to use that library's proprietary APIs to manipulate it.  With the Windows UI Automation framework the publisher of that control will expose behaviors.  If it's a funky Outlook Bar, perhaps it exposes ExpandCollapse also. 

You can query these controls for their behavior, ala “Reflection.”  Makes me think of how cool it was 8 or so years ago when I saw Spy++.  Except rather than presenting a physical “tree” this framework presents a logical, practical tree.  (The guy in front of me works for Infragistics.  I can only guess what awesome UI Controls they are going to build.  They kick much tush.)

The namespaces (alpha) are MSAvalong.Windows.Automation.  This framework supports ALL LEGACY controls, including VB, WinForms, Win32, etc.  There is also a complete Security Model so your testing software can't be used by the powers of darkness like .VBS files.

Along with this Logical Tree, you get all Properties, Events, Control Patterns and all Input (Mouse, Pen, Keyboard, etc).  Plus, it supports filtering, so you don't get messages shouting at you.

Rather than using the Class Name (and there are thousands) to identify a control and switch on how to test it, you think about the essense of the control and it's behavior.  For example, if you're testing software doesn't know what a control is, it asks it and hears “Oh, you're clickable? And expandable?” and you write tests appropriately.

(Awesome, he was just going to start a demo, but the screen saver locked his machine.  He can't remember the password...right now we're looking at a Longhorn security screen as he tries to log in...ouch...I know what this feels like.  He's going to reboot. Oy.)

Read: Avalon - CLI307: Automated UI Testing

Topic: PDC Information Overload Previous Topic   Next Topic Topic: PDC - Expo Hall Reception + Fun with NUnitAddIn

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use