I am talking about the add-in – UI Automation, which has been introduced with UFT 12.52. I hope, many of you have already noticed this add-in, If you have not – check it out! In this post, we are going to discuss a bit about this. I really appreciate the effort by HPE to keep UFT with the pace of changes to support the new technologies and versions. UI Automation add-in enables support for the application that has UI Automation interfaces implemented with Microsoft UI Automation Framework.

With UI Automation, UFT now supports test automation for applications technologies which are not supported out-of-the box. Also it enables support for the application or application controls which are not working adequately with the standard existing add-ins. By saying that, I immediately rushed to check the most troublesome automation challenge from the beginning. I hope everyone will agree to this challenging step to have  applications menu identified. And.. guess what, it does!! it does identify the menu object. Checkout below, I tried on Windows-Notepad Menu.

What is UI Automation Framework?

Microsoft .Net framework 3.0 and later includes this new accessibility framework called as Microsoft UI Automation Framework. It provides accessibility to most UI elements and it provides the information about UI element to the end user. You can interact with the UI by using automated test scripts. Read more about UI Automation framework here.

Did you notice the new add-in?

UI Automation Add-in can be used as any other add-ins available. Check the option on  for UI Automation at UFT Add-in Manager window at startup.

 

Once you have the add-in enabled, the special options are enabled for object spy and recording modes and options.

At object spy window, you will notice a drop-down option beside the spy button. Selecting UI Automation option, the spy button icon changes to object spy icon. It represents that UI Automation mode is enabled.

 

You can enable UI Automation mode while recording. Select UI automation from the recording mode drop down.

 

Rest is same as you do spy, add objects or record with other add-ins.

Here is the code snippets, that I tried on notepad menu.

SystemUtil.Run "C:\WINDOWS\system32\notepad.exe","","C:\Users\Saketk",""
UIAWindow("Untitled - Notepad").UIAMenu("Application").UIAObject("File").Click
UIAWindow("Untitled - Notepad").UIAMenu("Application").UIAObject("Open... Ctrl+O").Click
Window("Notepad").Dialog("Open").WinEdit("File name:").Set "tracker.txt"
Window("Notepad").Dialog("Open").WinObject("&Open").Click

Try it out and share your experience and tell us what you could figure out.

See also  UFT 12.53 Latest Service Packs

14 COMMENTS

  1. This is awesome! HP UFT team really keeps them upto the market needs. Thanks for sharing this Saket. This will solve a lot of day to day automation issues.

  2. Saket, Do you know if the Microsoft UI Automation Framework work with the MS Office products, UFT has never been able to do this before…

  3. Hi Saket,

    Will this ‘UI Automation Add-In’ work with Java based desktop application? (.jnlp extension)

    If yes, How can I get this add-in installed ? When I launch UFT, I am not able to see this add-in.

    Awaiting your response..

    Thanks,
    DJ

    • Hi DJ,
      Microsoft UI Automation Framework works with any app that uses native windows controls (like Java, Delphi, Silverlight etc) or controls which exposes their interface for accessibility. I believe it will work with your application as well. You should definitely give it a try. I dint get the jnlp extension. As far as I know jnlp files are used to launch java programs.

      Which UFT Version you are using? UI Automation Addin is included from UFT 12.52, make sure you select addin while installing. you can modify the installation and include this addin if you have UFT installed already.

  4. tryed with uft 14, but the performance is very slow. it literally forces to restart. not that happy with it.

    is there any setting needed to make it fast?

      • I have a case where when i use UIAutomation its properties are stored for that Action, and when i highligt it does highlight and when i drag and drop the Testobject, it shows on screen like this.

        UIAWindow(“Unified Service Desk for”).UIATab(“MainWorkArea”).UIATab(“Right Panel Top”).UIATable(“dGCases”).UIAObject(“LoggedCase”).Click

        but now it never clicks i have selected all the Addin object while starting the UFT.

        Any clue its higlighting but not clicking. ?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.