后来仔细观察,发现在执行这些失败用例的时候,系统总有个提示(可不要小瞧这提示,因为没有它,打死我我也不知道要去装下面的补丁。一开始就是忽略这个重要的提示,所以“杯具”了几个小时,呵呵!),要求去更新一下 Windows Automation API,地址连接如下: http://support.microsoft.com/kb/976779/
于是就按照提示,下载更新了一下基于x86的Windows Vista Automation API。很灵,更新完毕一切OK!
原来是在Vista和Windows 2003/2008等操作系统上,Coded UI Test的基石之一Windows Automation API版本比较就旧,需要更新到最新的Windows Automation API 3.0,而在Win7则不用。Windows Automation API包括了最新的Microsoft Active Accessiblity和Microsoft UI Automation。如果大家不是很了解这两项技术,下面是从MSDN上摘取的一段简介,言简意赅的对它们进行了解释:
" The Windows Automation API consists of two technologies—Microsoft Active Accessibility and Microsoft UI Automation. Microsoft Active Accessibility is the legacy accessibility technology that was introduced as a platform add-in for Windows 95, while Microsoft UI Automation is a newer, more capable technology that overcomes the limitations inherent in Microsoft Active Accessibility. "
" Although Microsoft Active Accessibility and UI Automation are two different technologies, the basic design principles are similar. The purpose of both technologies is to expose rich information about the UI elements used in Windows applications. Developers of accessibility tools can use this information to create software that makes applications running on Windows more accessible to people with vision, hearing, or motion disabilities. "
" Both Microsoft Active Accessibility and UI Automation expose the UI object model as a hierarchical tree, rooted at the desktop. Microsoft Active Accessibility represents individual UI elements as accessible objects, and UI Automation represents them as automation elements. Both refer to the accessibility tool or software automation program as the client. However, Microsoft Active Accessibility refers to the application or control offering the UI for accessibility as the server, while UI Automation refers to this as the provider."