AutoItLibrary - Documentation

Introduction

AutoItLibrary is a Robot Framework keyword library wrapper for for the freeware AutoIt tool (http://www.autoitscript.com/autoit3/index.shtml) using AutoIt's AutoItX.dll COM object. The AutoItLibrary class provides a proxy for the AutoIt keywords callable on the AutoIt COM object and provides additional high-level keywords implemented as methods in this class.

In the following documentation on each keyword, the keywords whose documentation is simply method <KeywordName> (e.g. "method ControlClick") are the native AutoIt keywords.  The detailed documentation for these keywords is available in the AutoItX documentation file: AutoItX.chm.  This file is installed as part of the installation of AutoItLibrary as:

C:\RobotFramework\Extensions\AutoItLibrary\AutoItX.chm

In order to discover the control identifiers in a given Windows GUI, AutoIt provides a standalone tool called the AutoIt Window Info Tool which is installed as part of the installation of AutoItLibrary as:

C:\RobotFramework\Extensions\AutoItLibrary\Au3Info.exe

This tool is documented here: http://www.autoitscript.com/autoit3/docs/intro/au3spy.htm

Importing

Arguments Documentation
OutputDir=., TimeOut=60, CaptureScreenOnError=False
OutputDir=<path> Output directory for captured screenshots. Should set to ${OUTPUTDIR}
Timeout=<seconds> Default TimeOut value in seconds.
This is used in other methods when their TimeOut parameter is not used.
CaptureScreenOnError=True Defaults to False.  Set to ${True} to capture the PC screen on any
AutoItLibrary keyword failure.

Shortcuts

Keywords

Keyword Arguments Documentation
Auto It Set Option strOption=, nValue= method AutoItSetOption
Block Input nFlag= method BlockInput
CD Tray strDrive=, strAction= method CDTray
Clip Get method ClipGet
Clip Put strClip= method ClipPut
Control Click strTitle=, strText=, strControl=, strButton=LEFT, nNumClicks=1, nX=-2147483647, nY=-2147483647 method ControlClick
Control Command strTitle=, strText=, strControl=, strCommand=, strExtra= method ControlCommand
Control Disable strTitle=, strText=, strControl= method ControlDisable
Control Enable strTitle=, strText=, strControl= method ControlEnable
Control Focus strTitle=, strText=, strControl= method ControlFocus
Control Get Focus strTitle=, strText= method ControlGetFocus
Control Get Handle strTitle=, strText=, strControl= method ControlGetHandle
Control Get Pos Height strTitle=, strText=, strControl= method ControlGetPosHeight
Control Get Pos Width strTitle=, strText=, strControl= method ControlGetPosWidth
Control Get Pos X strTitle=, strText=, strControl= method ControlGetPosX
Control Get Pos Y strTitle=, strText=, strControl= method ControlGetPosY
Control Get Text strTitle=, strText=, strControl= method ControlGetText
Control Hide strTitle=, strText=, strControl= method ControlHide
Control List View strTitle=, strText=, strControl=, strCommand=, strExtra1=, strExtra2= method ControlListView
Control Move strTitle=, strText=, strControl=, nX=, nY=, nWidth=-1, nHeight=-1 method ControlMove
Control Send strTitle=, strText=, strControl=, strSendText=, nMode=0 method ControlSend
Control Set Text strTitle=, strText=, strControl=, strControlText= method ControlSetText
Control Show strTitle=, strText=, strControl= method ControlShow
Control Tree View strTitle=, strText=, strControl=, strCommand=, strExtra1=, strExtra2= method ControlTreeView
Drive Map Add strDevice=, strShare=, nFlags=0, strUser=, strPwd= method DriveMapAdd
Drive Map Del strDevice= method DriveMapDel
Drive Map Get strDevice= method DriveMapGet
Get Active Window Image FilePath Capture an image of the active window into the given FilePath. The given FilePath must be relative to Robot Framework output directory, otherwise the embedded image will not be shown in the log file.
Get Auto It Version Returns a string with the version of the AutoItX COM object.
Get Screen Image FilePath Capture a full screen image into the given FilePath. The given FilePath must be relative to Robot Framework output directory, otherwise the embedded image will not be shown in the log file.
Get Version Returns a string with the version of the AutoItLibrary.
Ini Delete strFilename=, strSection=, strKey= method IniDelete
Ini Read strFilename=, strSection=, strKey=, strDefault= method IniRead
Ini Write strFilename=, strSection=, strKey=, strValue= method IniWrite
Init method Init
Is Admin method IsAdmin
Mouse Click strButton=LEFT, nX=-2147483647, nY=-2147483647, nClicks=1, nSpeed=-1 method MouseClick
Mouse Click Drag strButton=, nX1=, nY1=, nX2=, nY2=, nSpeed=-1 method MouseClickDrag
Mouse Down strButton=LEFT method MouseDown
Mouse Get Cursor method MouseGetCursor
Mouse Get Pos X method MouseGetPosX
Mouse Get Pos Y method MouseGetPosY
Mouse Move nX=, nY=, nSpeed=-1 method MouseMove
Mouse Up strButton=LEFT method MouseUp
Mouse Wheel strDirection=, nClicks=1 method MouseWheel
Opt strOption=, nValue= method Opt
Pixel Checksum nLeft=, nTop=, nRight=, nBottom=, nStep=1 method PixelChecksum
Pixel Get Color nX=, nY= method PixelGetColor
Pixel Search nLeft=, nTop=, nRight=, nBottom=, nCol=, nVar=0, nStep=1 method PixelSearch
Process Close strProcess= method ProcessClose
Process Exists strProcess= method ProcessExists
Process Set Priority strProcess=, nPriority= method ProcessSetPriority
Process Wait strProcess=, nTimeout=0 method ProcessWait
Process Wait Close strProcess=, nTimeout=0 method ProcessWaitClose
Reg Delete Key strKeyname= method RegDeleteKey
Reg Delete Val strKeyname=, strValuename= method RegDeleteVal
Reg Enum Key strKeyname=, nInstance= method RegEnumKey
Reg Enum Val strKeyname=, nInstance= method RegEnumVal
Reg Read strKeyname=, strValuename= method RegRead
Reg Write strKeyname=, strValuename=, strType=, strValue= method RegWrite
Run FileName, WorkingDir=, Flag= Direct wrapper for AutoIt's Run method.

This is required in order to do error code translation into exceptions for Robot Framework.
Run As Set strUser=, strDomain=, strPassword=, nOptions= method RunAsSet
Run Wait strRun=, strDir=, nShowFlags=1 method RunWait
Send strSendText=, nMode=0 method Send
Shutdown nFlags= method Shutdown
Statusbar Get Text strTitle=, strText=, nPart=1 method StatusbarGetText
Tool Tip strTip=, nX=-2147483647, nY=-2147483647 method ToolTip
Wait For Active Window WindowTitle, WindowText=, TimeOut=-1 Wait up to TimeOut seconds for the window with the given WindowTitle and optional WindowText to appear. Force this to be the active window after it appears.  Optionally do a full screen capture on failure.

Parameters:
WindowTitle=<string> Title of the application window expected to appear
[WindowText=<string>] Optional text on the window expected to appear
[TimeOut=<seconds>] Optional overide to the default timeout set in __init__
Win Activate strTitle=, strText= method WinActivate
Win Active strTitle=, strText= method WinActive
Win Close strTitle=, strText= method WinClose
Win Exists strTitle=, strText= method WinExists
Win Get Caret Pos X method WinGetCaretPosX
Win Get Caret Pos Y method WinGetCaretPosY
Win Get Class List strTitle=, strText= method WinGetClassList
Win Get Client Size Height strTitle=, strText= method WinGetClientSizeHeight
Win Get Client Size Width strTitle=, strText= method WinGetClientSizeWidth
Win Get Handle strTitle=, strText= method WinGetHandle
Win Get Pos Height strTitle=, strText= method WinGetPosHeight
Win Get Pos Width strTitle=, strText= method WinGetPosWidth
Win Get Pos X strTitle=, strText= method WinGetPosX
Win Get Pos Y strTitle=, strText= method WinGetPosY
Win Get Process strTitle=, strText= method WinGetProcess
Win Get State strTitle=, strText= method WinGetState
Win Get Text strTitle=, strText= method WinGetText
Win Get Title strTitle=, strText= method WinGetTitle
Win Kill strTitle=, strText= method WinKill
Win Menu Select Item strTitle=, strText=, strItem1=, strItem2=, strItem3=, strItem4=, strItem5=, strItem6=, strItem7=, strItem8= method WinMenuSelectItem
Win Minimize All method WinMinimizeAll
Win Minimize All Undo method WinMinimizeAllUndo
Win Move strTitle=, strText=, nX=, nY=, nWidth=-1, nHeight=-1 method WinMove
Win Set On Top strTitle=, strText=, nFlag= method WinSetOnTop
Win Set State strTitle=, strText=, nFlags= method WinSetState
Win Set Title strTitle=, strText=, strNewTitle= method WinSetTitle
Win Set Trans strTitle=, strText=, nTrans= method WinSetTrans
Win Wait WindowTitle, WindowText=, TimeOut=-1 Direct wrapper for AutoIt's WinWait method.

This is required in order to do return code translation into exceptions for Robot Framework. On failure, optionally captures the full screen image to FAIL_WinWait_<n>.png.
Win Wait Active WindowTitle, WindowText=, TimeOut=-1 Direct wrapper for AutoIt's WinWaitActive method.

This is required in order to do return code translation into exceptions for Robot Framework. On failure, optionally captures the full screen image to FAIL_WinWaitActive_<n>.png.
Win Wait Close WindowTitle, WindowText=, TimeOut=-1 Direct wrapper for AutoIt's WinWaitClose method.

This is required in order to do return code translation into exceptions for Robot Framework. On failure, captures the full screen image to FAIL_WinWaitClose.png.
Win Wait Not Active strTitle=, strText=, nTimeout=0 method WinWaitNotActive