Jump to content
Sign in to follow this  
muchado

AutoIT & UI Automation

Recommended Posts

muchado

I have found AutoIT to be very useful in automating some of the older programs that we use, but I am now trying to work out how to automate newer programs that use the Windows Forms - such as WindowsForms10.Window.8.app.0.2bf8098_r13_ad1

I have read through the manual, but do not find anything on this there. I have also done some reading on the forum and have found material that looks useful, but I am not familiar with this and some of the threads look a little old. Please could someone update me on what the latest status is on this?

  • Are there any plans to provide wrappers to the UI Automation controls, similar to those already provided for ListView, ComboBox, etc?
  • How would I go about making a menu selection with such a system?
  • If people are not using AutoIT for this kind of automation, then what are they using instead?

Similar threads:

Other questions if you have time...

  • What is the difference between MSAA mode and UI Automation?
  • If I am using "Inspect.exe", how do I identify what information that I need to send a command to the control?

Sorry - lots of questions - I am very much finding my way around this.

 

Share this post


Link to post
Share on other sites
LarsJ

muchado, Windows Forms can be automated with the UI Automation framework. (How could you fail to find that thread? You need to improve your searching skills.)

Download the two UDFs in bottom of first post, and download and run the code in the "Simple spy demo" codebox in the middle of first post.

To verify that a control can be identified place the mouse cursor over the control and press Ctrl+w. You can see an example here.

Note that the framework is based on COM interface objects (created with ObjCreateInterface), so it's not just as easy to use as most built-in commands.

One of the UDFs contain wrapper functions to make everything a little bit easier. But it's still not as easy to use as built-in commands.

To see how to automate a menu system, just go through some of the examples (you can test some searching here).

When it comes to pure UI Automation, you can do everything with AutoIt as you can do with C++. There is really no need to use anything else. And I don't know what people else are using.

When you are using MSAA mode (in Inspect.exe), the information is provided with the old MS Active Accessibility API (IAccessible interface and some helper functions, both are implemented in the UI Automation framework). When you are using UI Automation mode, the information is provided with the new UI Automation interfaces. UI Automation is much better (and bigger) than MSAA.

With the "Simple spy demo" it's much easier to identify a specific control or window, than it is with Inspect.exe. I'm mostly using Inspect.exe to verify that the "Simple spy demo" does provide correct information. And it does.

In addition to UI Automation and IAccessible interfaces, IAccessible2 and ISimpleDOM are implemented too.

  • Like 1

Share this post


Link to post
Share on other sites
muchado

Have you looked through the IUIAutomation UDF thread in the examples section?

'?do=embed' frameborder='0' data-embedContent>>

Thanks!

muchado, Windows Forms can be automated with the UI Automation framework. (How could you fail to find that thread? You need to improve your searching skills.)

Download the two UDFs in bottom of first post, and download and run the code in the "Simple spy demo" codebox in the middle of first post.

To verify that a control can be identified place the mouse cursor over the control and press Ctrl+w. You can see an example here.

Note that the framework is based on COM interface objects (created with ObjCreateInterface), so it's not just as easy to use as most built-in commands.

One of the UDFs contain wrapper functions to make everything a little bit easier. But it's still not as easy to use as built-in commands.

To see how to automate a menu system, just go through some of the examples (you can test some searching here).

When it comes to pure UI Automation, you can do everything with AutoIt as you can do with C++. There is really no need to use anything else. And I don't know what people else are using.

When you are using MSAA mode (in Inspect.exe), the information is provided with the old MS Active Accessibility API (IAccessible interface and some helper functions, both are implemented in the UI Automation framework). When you are using UI Automation mode, the information is provided with the new UI Automation interfaces. UI Automation is much better (and bigger) than MSAA.

With the "Simple spy demo" it's much easier to identify a specific control or window, than it is with Inspect.exe. I'm mostly using Inspect.exe to verify that the "Simple spy demo" does provide correct information. And it does.

In addition to UI Automation and IAccessible interfaces, IAccessible2 and ISimpleDOM are implemented too.

Thanks for the additional information and for the relative value of MSAA and UI Automation. That is very helpful.

It is strange that I didn't find that posting. My searching skills are generally quite good and I thought I had put some of those terms in my Google Search. I found plenty that was written by junkew and spent quite a lot of time reading his posts as well as those by others.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • RomanY
      By RomanY
      Hi all,
      I have simple question and can not find answer on it. I am working with WPF application and I want to automate it with Autoit. For now I found Inspect.exe tool which gives me all wpf controls, but how do I can use that controls to click some buttons or dropdown list?
      For example I have such a controls
      AutomationId:    "comboArrayType" or 
      Name:    "_Submit"
      Which autoit command can I use to handle this?
      Thanks and Regards, Roman Y
    • 232showtime
      By 232showtime
      Good  day, its my first time creating script using UIA Wrappers. im kinda confused:
      #include "UIAWrappers.au3" $FrmClassName="TFrmMain" $Button1="Add" ;script is clicking all the button, if I use all the button name in this control->[CLASS:TBitBtn; INSTANCE:12] $Form=_UIA_getFirstObjectOfElement($UIA_oDesktop,"class:=" & $FrmClassName, $treescope_children) if isobj($Form) Then $Button2=_UIA_getFirstObjectOfElement($Form,"name:=" & $Button1, $treescope_subtree) $oInvokeP=_UIA_getpattern($Button2,$UIA_InvokePatternID) $oInvokeP.Invoke EndIf  
      but if I use the option name in [CLASS:TActionMainMenuBar; INSTANCE:1] it doesn't click any option in menu bar like "File", "View" or "Edit" and got error mesage
       
      #include "UIAWrappers.au3" $FrmClassName="TFrmMain" $Button1="File" ;doesnt click File, View or edit in menubar $Form=_UIA_getFirstObjectOfElement($UIA_oDesktop,"class:=" & $FrmClassName, $treescope_children) if isobj($Form) Then $Button2=_UIA_getFirstObjectOfElement($Form,"name:=" & $Button1, $treescope_subtree) $oInvokeP=_UIA_getpattern($Button2,$UIA_InvokePatternID) $oInvokeP.Invoke EndIf ;got error "C:\Program Files (x86)\AutoIt3\Include\UIAWrappers.au3" (514) : ==> Variable must be of type "Object".: $obj.getCurrentPattern($patternID, $pPattern) $obj^ ERROR ->09:03:47 AutoIt3.exe ended.rc:1
      +>09:03:47 AutoIt3Wrapper Finished.
      >Exit code: 1    Time: 1.383
       
       
       
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.