(Lviv community of .NET developers)

UI Automation overview (Part I)

September 5, 2007 15:06 by fors

Introduction

Microsoft UI Automation is the new accessibility framework for Microsoft Windows. It addresses the needs of assistive technology products and automated test frameworks by providing programmatic access to information about the user interface (UI). In addition, UI Automation enables control and application developers to make their products accessible.
UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.
UI Automation provides full functionality in Windows Vista, Microsoft Windows XP, and Windows Server 2003.


Advertisement
Public Folder Watcher (PFW) is an add-on for Microsoft Outlook enabling support of notifications about changes in Exchange Public Folders and providing a status of unread email messages.

Who will use UI Automation?

The latest research study, commissioned by Microsoft and conducted by Forrester Research, shows that 57 percent (74.2 million) of working-age computer users (aged 18-64) in the U.S. are likely to benefit from using accessible technology. The research also confirms that the number of people who could benefit from accessible technology is increasing rapidly as the global population grows older and more people experience age-related difficulties and impairments related to vision, hearing and dexterity.
UI Automation is divided into two branches: UI Automation Providers and UI Automation Clients. UI Automation providers are applications such as MS Word, Excel, or any other program which can be used by users who need accessible technology support. UI Automation Clients are assistive technology applications, such as screen readers, screen enlargers,alternative input or others. Automated test scripts can use UI Automation for automated testing and are also considered clients in the UI Automation model.    

      

How will this help assistive technology developers?

With current technology, assistive technology developers are required to use many different approaches to obtain and present information about the UI to computer users who rely on assistive technology products. These developers therefore spend an inordinate amount of time and resources gathering the UI information required for their application instead of spending this time innovating in their feature set. UI Automation reduces the cost for these developers by delivering the most complete accessibility model in the industry. It will become the primary source of UI information for the next generation of assistive technology products. 

UI Automation Model

UI Automation exposes every piece of the UI to client applications as an AutomationElement. Elements are contained in a tree structure, with the desktop as the root element. Clients can filter the raw view of the tree as a control view or a content view. (These standard views of the structure can be easily seen using the UI Spy application). Applications can also create custom views.
AutomationElement objects expose common properties of the UI elements they represent. One of these properties is the control type, which defines its basic appearance and functionality as a single recognizable entity: for example, a button or check box. There are special helper classes and methods, that allow to obtain any UI element as AutomationElement object. So you can find any element you need by name, type, id, etc. walking through the tree.
In addition, elements expose control patterns that provide properties specific to their control types. Control patterns also expose methods that enable clients to get further information about the element and to provide input.
There is not  one-to-one correspondence between control types and control patterns. A control pattern may be supported by multiple control types, and a control may support multiple control patterns, each of which exposes different aspects of its behavior. For example, a combo box has at least two control patterns: one that represents its ability to expand and collapse, and another that represents the selection mechanism.
UI Automation also provides information to client applications through events. Unlike WinEvents, UI Automation events are not based on a broadcast mechanism. UI Automation clients register for specific event notifications and can request that specific UI Automation properties and control pattern information be passed into their event handlers. In addition, a UI Automation event contains a reference to the element that raised it. Providers can improve performance by raising events selectively, depending on whether any clients are listening.

How to use this all?

All standard WPF controls support UI Automation automatically, custom controls must provide support for UI Automation through classes and interfaces. But you should bear in mind, that the implementation for Windows Presentation Foundation (WPF) elements and non-WPF elements (such as those designed for Windows Forms) is fundamentally different.
For deeper consideration of what we can do with UI Automation, there are two projects, which make it more obvious.

  • UITree - Finds an application by title or by process ID, starting from a desktop as a root and builds its UI tree like UI Spy utility. Different types of view are available:
    1. Raw View. The raw view of the UI Automation tree is the full tree of AutomationElement objects for which the desktop is the root. The raw view closely follows the native programmatic structure of an application and therefore is the most detailed view available. It is also the base on which the other views of the tree are built. Because this view depends on the underlying UI framework, the raw view of a WPF button will have a different raw view than a Win32 button.
    2. Control View. The control view of the UI Automation tree simplifies the assistive technology product's task of describing the UI to the end user and helping that end user interact with the application because it closely maps to the UI structure perceived by an end user.
      The control view is a subset of the raw view. It includes all UI items from the raw view that an end user would understand as interactive or contributing to the logical structure of the control in the UI. Examples of UI items that contribute to the logical structure of the UI, but are not interactive themselves, are item containers such as list view headers, toolbars, menus, and the status bar. Non-interactive items used simply for layout or decorative purposes will not be seen in the control view. An example is a panel that was used only to lay out the controls in a dialog but does not itself contain any information. Non-interactive items that will be seen in the control view are graphics with information and static text in a dialog. Non-interactive items that are included in the control view cannot receive keyboard focus.
    3. Content View. The content view of the UI Automation tree is a subset of the control view. It contains UI items that convey the true information in a user interface, including UI items that can receive keyboard focus and some text that is not a label on a UI item. For example, the values in a drop-down combo box will appear in the content view because they represent the information being used by an end user. In the content view, a combo box and list box are both represented as a collection of UI items where one, or perhaps more than one, item can be selected. The fact that one is always open and one can expand and collapse is irrelevant in the content view because it is designed to show the data, or content, that is being presented to the user.

      Note: If you want to explore your own application user interfase, you must make all UI Automation calls on a separate thread.

  • WPFStressTest - This is a nice sample that uses the UI Automation API's that come with WPF to stress test your application. Just run Stress.exe -pid [processId] or Stress.exe -title [windowTitle]. And see if your app can survive being taken through its paces over a 24 hour period.

UITree.zip (11,09 kb)

WPFStressTest.zip (17,26 kb)


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: , ,
Categories: WinFx
Actions: Permalink | Comments (92) | RSSRSS comment feed

Comments

March 4. 2009 17:08

Pingback from blog dotcom-monitor.com 的实现者同样可以以 UI Automation overview (Part I) 组件的形式在运行时动态载入。由于组件间的依赖关系的制约,所以组件实例化的顺序需要特别考虑

web load stress test

November 29. 2009 14:38

You really made a well posted article having a useful information about BlogEngine.Net and these really helps me to solve my problem about my blog and on what type of blogengine I will b going to use on it. Thank you so much!

Private Labeling

January 26. 2010 14:24

Hey, that are somekind of contribution and it sounds very. I only use email for my business communication and I use Outlook Express as my email client with the help of Email Sorter Wizard(an Outlook add-on) because I can get all my email filled. Fortunately I read your post that sent to me by my family, greatly done.

get your ex wife back

January 27. 2010 11:24

Anyone could kindly help me to remove the malware I get from googleanalytics.net? When I first came across your site I thought the virus is yours because of the popup. Nah, I know that is not yours but if your or anyone can provide me a guide on how to remove it I will thanks him millions time.

mafia wars tips

February 15. 2010 11:45

A very brief article written about UI Automation but it's so knowledgeable that everyone must have a look of this.

trophy shop

February 25. 2010 00:27

I love this blog

Billy

March 7. 2010 02:10

nice blog i learn a lot from it. Thanks for sharing. regards, rosela

Watch Pacquiao Vs Clottey Live

March 8. 2010 00:16

This is a real attention grabber about development. Nice to see someone get it right.
Last week I read a really boring report..this was refreshing.

Bradly

March 15. 2010 07:36

I can�t wait until my professor reads my report on development because this info gave me exactly what I needed.
but he'll still be shocked.

William

March 16. 2010 02:05

Love the way this reads, not like the stories I usually read

Marquita

March 16. 2010 17:35

I love this blog, I will came back

Joana Horde leveling guide

March 17. 2010 03:32

What a super blog, I am really have fan of your blog.

Stephen

March 17. 2010 12:35

I love this blog\post, I will came back later

Castiga bani pe net

March 17. 2010 16:58

Your blog is so informative. keep up the good work.

doll games

March 21. 2010 03:11

Great blog, keeping me from working

Axiss

March 22. 2010 09:16

Great, its stopped me from working for a good bit now :)
Im gonna mark it just now,
Nice to see other bloggers writing about development,
Keep up the good work

Isabella- Click Here To Lose Weight Fast

March 24. 2010 14:17

Figure I'm not so smart concerning development as I imagined. Useful read, appreciate your posting this.

passing a drug test

March 25. 2010 02:14

I'm interested in learning more on development.
Thanks for this post

Laptop

March 28. 2010 03:21

Not at all ordinary, this is actually very interesting probably because its about development.

John

March 30. 2010 04:57

Actually, I agree with you about this issue.
Many site write this article, and your site is the good one.
Thanks.

Regards

Jams

Acne skin treatment

April 1. 2010 06:25

I love this blog

SHERWOOD

April 4. 2010 00:16

Posting a good friend, I really like it ...^_^

technology

April 7. 2010 17:43

This is interesting, post more often!

Someone

April 8. 2010 12:29

Interesting post :) However, some of the comments people have made above are questionable, need to think a little bit more in depth

STACIE

April 14. 2010 08:47

What a super blog!

bad credit

April 15. 2010 09:45

I've been following your blog for 3 days now and i should say i am starting to like your post. and now how do i subscribe to your blog?

Thanks
Dave

colors

April 17. 2010 10:04

Well crafted document i've enjoyed just about every moment of it, also the details found here is great. Tnks

Thomas Correia

April 17. 2010 14:47

I was just browsing for related blog posts for my project research and I happened to stumble upon yours. Thanks for the excellent information

Another keyword

April 18. 2010 03:34

I've observed the info what i'd been looking for, thanks for this excellent document. Carry on the excellent work

Allen Jesse

April 18. 2010 03:37

There are so few blogs and forums that have appropriate data but this exceeded my prospects, appreciate your sharing

William Rick

April 18. 2010 03:57

great post u write here :)

Justin

April 19. 2010 22:05

Perhaps you have considered adding up extra video clips about development to your weblog posts to hold the visitors more entertained? I mean I just read through the whole article of yours and it was fully pleasant but since I'm more of a visual learner,I found that for being further helpful well let me know how it turns out! I enjoy what you guys are always up too. Such clever work and reporting! Continue the great works guys I've added you guys to my blogroll. This is a good article thanks for sharing this informative information.. I will visit your blog regularly for some latest post.

Kandra Sramek

April 20. 2010 09:14

Hi,
I have been read and following your site for 3 days and now I starting to like your post.
I feel enjoy to read your article.

Thanks

Outdoor Recreation

April 21. 2010 07:49

It's an amazing, thanks for sharing..

game kids

April 21. 2010 10:08

Everything in this blog is completely true! In addition you've created an excellent blog post once again! Your writing style about development is impeccable, I really enjoy the articles. I check your site regularly and enjoy the fact its popular and has frequent users, please post about development more often.

Jackson

April 22. 2010 14:56

I read your blog all the time and I just thought I’d say keep up the good work!

firande

April 23. 2010 03:26

I love your blog

Morris

April 29. 2010 08:51

Kinda got hooked on this web site thus will likely be bookmarking this internet page for easy connection

Beulah Carlos

April 30. 2010 12:20

I�m glad I chose to read this one. Good work!

Philip

May 3. 2010 20:50

I love your site cause it contain very attractive article

Billy

May 4. 2010 15:39

It's not very often that I come across an honest Individual who stands for what's right. I am 100% behind your theories.

download the rapid income creator

May 5. 2010 15:22

I was looking for ideas regarding themes. I noticed that your theme looks just the type of thing I am looking for. Do you know where I can get it and if it comes with an indepth tutorial?

top reviews of the rapid income creator

May 6. 2010 03:06

Many thanks for posting the facts.

microsoft points

May 9. 2010 18:21

Great post keep it up

Remove Acne Scars

May 16. 2010 06:42

Well that is interesting. If any of you have any need to do a cell phone search click on my name. You won't beleive the days of frustration it will save you.

cell phone search

May 29. 2010 18:55

Thanks for the post.:) I love reading it.

youssef mzaoui

May 31. 2010 09:23

I thank you for your article this search has an end right now. You wrote the article in a very comprehensive way. So I want to say thanks and add your blog to my favorites just now. Enjoy the day

colon cleansing

May 31. 2010 09:24

This is a really good read for me, Must admit that you are one of the best blogger I ever saw.Thanks for posting this informative article.

Acupuncture

June 5. 2010 21:35

I cannot see your site properly on my iPhone (I have the 3G, not 3GS). Anyway, I have put your RSS into my laptop, so thanks!

Andryan Slbecky

June 9. 2010 23:17

Hey this is the blog, ohhh nice furniture info too.

johnston casuals furniture

June 11. 2010 06:16

Very interesting post thank you!

brain training

June 13. 2010 16:58

Is there a way to subscribe?

brain vitamins

June 13. 2010 19:42

You know your development stuff. Great work, by the way.

Steven

June 13. 2010 23:32

This is interesting and I found a couple of questions answered that I have been researching for about a year. Please keep up the momentum and post about development more often!

Alex

June 16. 2010 10:08

Women taking oral contraceptives and those who are taking a hormone replacement therapy during menopause are statistically a little more likely to have Melasma.

Tri Luma cream

June 16. 2010 21:40

Love your blog first of all, what a great post, we are trying to write about similar subjects, so this article has really inspired me! Let's hope I form some ideas and make a great post. Thanks for the help, Bookmarked.

gollum

June 20. 2010 16:54

Hmmmm, not sure I understand everything stated If any of you have any need to do a cell phone search click on my name. You will not beleive the amount of time it will save you.

cell number lookup

June 20. 2010 19:30

Well that is interesting. If a few of you have any need to check on a number click on my name. You will not beleive the amount of time it will save you.

best cell number lookup

June 23. 2010 13:14

Keep posting stuff like this i really like it

detoxiana

June 24. 2010 14:17

I'm reading this post from my I-Phone and it looks great! I like your writing style and you make some excellent points about development.

mc hammer

June 30. 2010 20:53

Thank you for one more nice article. The place else may anybody get that kind of information in such an ideal approach of presentation

barcelona shirt

July 1. 2010 04:28

Everything in this blog is completely true! In addition you've created an excellent blog post once again! Your writing style about development is impeccable, I really enjoy the articles. I check your site regularly and enjoy the fact its popular and has frequent users, please post about development more often.

jason

July 1. 2010 11:53

Took me awhile to read all the comments, but I really enjoyed the article. It proved to be very useful to me and I am sure to all the commenters here! It�s always nice when you can not only be informed, but also engaged! I�m sure you had fun writing this article.

Jill

July 3. 2010 09:38

Thanks for this amazing article. I am refreshed after reading this. Thank you!

Insurance Choices

July 5. 2010 11:20

The Big 10 Football Nation Forum can be a website in which it is possible to discuss just about anything concerning the NCAA Big 10 Football Conference. You may also discuss about many other issues like other NCAA Football Conferences, other sports, every day chit chat, and many other topics. There can be a unique VIP Section exactly where you could acquire, market, trade, or have sports bets with other members. http://www.big10footballnation.net/forums/forum.php

big 10 football forum

July 5. 2010 15:05

The Big 10 Football Nation Forum is a site where you'll be able to talk about just about something in regards to the NCAA Big 10 Football Conference. You could also discuss about all sorts of other issues like other NCAA Football Conferences, other sports, every day chit chat, and a myriad of other topics. There is usually a special VIP Section exactly where you may possibly purchase, sell, trade, or have sports activities bets with other members. http://www.big10footballnation.net/forums/forum.php

football nation

July 5. 2010 17:03

Trubloods.com is actually really a internet site dedicated to be able to giving you all with the many advantages since well because night through the strike display True Blood. True Blood is actually known as as the actual synthetic blood vessels that the particular western have got produced and now vampires arise via the particular darkness in order to attempt and exist together along with human beings. An individual stick to Sookie Stackhouse because the actual lady offers employing the actual chaos which is actually out there on the world. There's ambiance, comedy, actions, and many any lot more as a person watch pumpkin heads, humans and supernaturals clash in the city of Bon Temps, Louisiana. View totally free channels at trubloods.com!

online stream

July 6. 2010 14:14

As anybody understands respect is one of the most very important between people's existence. Only respect one another to obtain along properly and I consider that leaving one's opinion can be a behavior of respect. Do you feel so?

supra tk society

July 6. 2010 21:14

I really like your blog about development :) This is my second visit to your site and I think I might just have to subscribe, thanks for posting about development . Peace.

gollum

July 7. 2010 22:19

Thanks for the information, can I use the information on my blog? I'll provide a back link to your site :)

jason

July 8. 2010 03:24

Terrific, practical implementable ideas. One of my challenges is keeping track of all the interesting things I come across that could be used... I have updated the old journalists idea of a clipping file to a bookmark folder called "Blog Ideas".

mark

July 8. 2010 11:08

Trubloods.com will be genuinely the web site dedicated to be able to bringing you almost all in the goodness since well since night with the struck show True Blood. True Blood is named since the synthetic bloodstream how the actual western have produced and also these days vampires emerge in the night in order to attempt and also exist together together with individuals. An individual follow Sookie Stackhouse as the actual lady deals with the turmoil which exists in the world. There is certainly love, humor, motion, and also several the whole lot more as you notice pumpkin heads, folks as well since supernaturals clash in the community associated with Bon Temperatures, Louisiana. View completely free channels with trubloods.com!

lafayette

July 8. 2010 13:40

The Big 10 Football Nation Forum is a web site in which you'll be able to examine just about anything at all in regards to the NCAA Big 10 Football Conference. You may also examine about many other issues like other NCAA Football Conferences, other sports, daily chit chat, and a myriad of other topics. There may also be a unique VIP Section exactly where you might purchase, market, trade, or have sports activities bets with other members. http://www.big10footballnation.net/forums/forum.php

big 10 football

July 8. 2010 14:23

I found this website and I love it .. I would often visit and look forward interesting posts here

detoxiana

July 8. 2010 14:55

Trubloods.com will be really any site dedicated to be able to providing every single one particular regarding the many advantages and night together with the hit show True Blood. True Blood is known as due to the fact the manufactured blood the japanese have designed now vampires associated with the particular underworld arise through the particular darkness in order to try and exist together with humans. An individual follow Sookie Stackhouse as your woman offers although using chaos in which is out there on the planet. There's ambiance, comedy, action, and many more while you monitor vampires, humans and supernaturals collide inside of the city associated with Bon Temps, Louisiana. View entirely free streams with trubloods.com!

vampire

July 8. 2010 16:49

The Big 10 Football Nation Forum can be a web site where you may examine just about anything at all about the NCAA Big 10 Football Conference. You might also talk about about many other things like other NCAA Football Conferences, other sports activities, every day chit chat, and other topics. There is also a special VIP Section where you might purchase, sell, trade, or have sports activities bets with other members. http://www.big10footballnation.net/forums/forum.php

ncaa

July 9. 2010 01:32

I really like your blog about development :) This is my second visit to your site and I think I might just have to subscribe, thanks for posting about development . Peace.

dobby

July 12. 2010 05:15

I love this blog

Home Dehumidifiers

July 13. 2010 02:15

I'm reading this post from my I-Phone and it looks great! I like your writing style and you make some excellent points about development.

riely

July 14. 2010 17:21

There is lot of good information on this post, my friends might find this relevant, I will send them a link. Thanks!

creative recreation

July 14. 2010 19:13

I�m glad I chose to read this one. Good work!

vibram fivefingers

July 15. 2010 16:55

Hey, examine out this website were you may Xbox 360 games, components and points for positively totally free! All you could have to do is sign up and comprehensive some surveys and you also are set. It is 100% safe and free! www.FreeGamesFor360.com

runescape

July 16. 2010 12:42

Niiiiiiice.

kitting services

July 16. 2010 18:03

Hey, verify out this web site were you could Xbox 360 games, add-ons and points for completely no cost! All you have got to total is sign up and complete some surveys and you also are set. It is 100% secure and free! www.FreeGamesFor360.com

runescape

July 17. 2010 10:16

I just couldn't leave your website before saying that I really enjoyed the quality information you offer. Will be back often to check up on new stuff you post!

sarah

July 18. 2010 03:46

Hi, I can' figure it out, but when I enter your feed into Google reader, it doesn't work. Can you give me the RSS URL just to make sure I'm using the right one? I appreciate it. :)

Lynna Forkum

July 18. 2010 19:19

Thanks for the post, enjoyed it.

brushed aluminium badges

July 19. 2010 00:56

Greetings from California

color name tags

July 21. 2010 06:16

I read the articles and all the things here inside this blog .,I got many information that I really need .,Thanks for sharing.,

injury lawyer

July 21. 2010 16:38

Following looking close to for a legitimate hotmail password hack application, I identified this software. Be mindful with it even though, I do not know no matter whether it is legal to use it to hack someones hotmail or yahoo account password, its only legal to utilize it on your individual while you forget the password. http://www.hotmailpasswordhack.net

hotmail password

July 23. 2010 16:08

to manga and anime including shops, graphic index of french and english translated anime

free manga download

July 24. 2010 01:44

Fantastic and inspirational posting. I love your blog and judging by the commentary you have a great list of followers. Will bookmark this site and keep updated..cheers!
http://www.nikeairjordan.cc

Rerto Jordans

Add comment


(Will show your Gravatar icon)