Using AutoIt for Native Windows


Author: Dharmesh Patel
Update: OCT 26, 2015 Carl Nagle

Copyright, SAS Institute http://www.sas.com
General Public License (GPL):  http://www.opensource.org/licenses/gpl-license.php


1.        What is AutoIt?

AutoIT is a freeware test automation tool provided by Jonathan Bennett and the AutoIt Team designed for automating native Microsoft Windows apps and components.

SAFS uses and controls AutoIt via AutoItX Java Bridge as a standard SAFS Engine so the user does NOT have to learn the Java API, the AutoIt Scripting Language, or the AutoItX COM API.  The AutoItX Java Bridge is provided freely as open source by Richard Kanavati on GitHub.

 

2.        How can I use AutoIT with other engines?

Just add  :autoit:  prefix at beginning of the main window recognition string and/or component recognition string. 

Example:  User can define appmap following way

 

 [Calculator]

 Calculator=":autoit:title=Calculator"

 Num3="class=Button;id=133"

 

 [Calculator]

 Calculator=":autoit:title=Calculator"

 Num3="id=133"

Consult this link for more info on SAFS AutoIt Recognition Strings.

3.        How can I capture AutoIT recognition string(RS)?

 Au3Info.exe or Au3Info_x64.exe is located in 'c:\safs\lib' or 'c:\seleniumplus\extra' dir.

 

4.        How to define AutoIT recognition string(RS)?

The recognition string is composed with pairs of RSkey=value separated by semi-colon ; such as key1=value;key2=value
Please refer to SAFS AutoIt Recognition Strings for more information.

Examples: The application Calculator's "radio button Radians" is captured as below:

Then the Recognition String can be defined as:

Note:
1. "Caption=" accepts also "wildcard string", * for zero or more characters; ? for one character.
"Caption=" is equivalent to "Title=" if the value is a normal string;
"Caption=" is equivalent to "RegexpTitle=" if the value is a wildcard string;

2. "Index=" is equivalent to "Instance=".

 

5.        Is AutoIT not working?

 When AutoIt load, DLLs will be registered to the system. If AutoIT already installed to the system then uninstall AutoIT or DLLs.