Updated first post with new wrappers/fixes etc.
For this example to work you have to make a file UIA.CFG where you can store some of the data
For identifying controls I try to put in the dutch and english values for propery names. Sometimes its a best guess for english (I test against a dutch windows)
Example 11 Word 2010, Calculator, Notepad
#include "UIAWrappers.au3"
#AutoIt3Wrapper_UseX64=N
;~ Start the system under test applications
_UIA_StartSUT("SUT1") ;~Calculator
_UIA_StartSUT("SUT2") ;~Notepad
_UIA_StartSUT("SUT3") ;~MS Word
;~ To be moved to UID (User interface definition) files
;~ Set the system under test UID objects to recognize
local $UID_WORD[4][2] = [ _
["mainwindow","classname:=OpusApp"], _
["btnZoeken","name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl\+F"] , _
["document","classname:=_WwG"], _
["btnBold","name:=((Vet)|(Bold))"] _
]
_UIA_setVarsFromArray($UID_Word,"Word.")
local $UID_CALC[7][2] = [ _
["mainwindow","classname:=CalcFrame"], _
["1","name:=1; controltype:=button"], _
["2","name:=2; controltype:=button"] , _
["3","name:=3; controltype:=button"] , _
["BACKSPACE","AutomationId:=83"] , _
["mnuEdit","name:=((Edit)|(Bewerken)); controltype:=MenuItem"], _
["mnuCopy","name:=((Copy.*)|(Kopi.*)); controltype:=MenuItem"] _
]
_UIA_setVarsFromArray($UID_CALC,"Calculator.")
local $UID_NOTEPAD[4][2] = [ _
["mainwindow","classname:=Notepad"], _
["title","controltype:=50037"], _
["mnuEdit","name:=((Edit)|(Bewerken))"], _
["mnuPaste","name:=((Paste.*)|(Plak.*))"] _
]
_UIA_setVarsFromArray($UID_NOTEPAD,"Notepad.")
;~ To be moved to 1 or multiple scriptfiles
;- Set the script
;~ The actual script, 50,10 is only there if a lot of lines and parameters are needed
local $script[50][10]= [ _
["Word.Mainwindow","setfocus"], _
["Word.btnBold", "click"], _
["word.document", "sendkeys", "hello world"], _
["word.btnZoeken", "click"], _
["calculator.mainwindow", "setfocus"], _
["calculator.1","click"], _
["calculator.2","click"], _
["calculator.3","click"], _
["calculator.backspace","click"], _
["calculator.mnuEdit","click"], _
["calculator.mnuCopy","click"], _
["notepad.mainwindow", "setfocus"], _
["notepad.mnuEdit","click"], _
["notepad.mnuPaste","click"], _
["notepad.mainwindow","setvalue", "hello world"] _
]
_UIA_launchScript($script)
Exit
save this to UIA.CFG file
; This is an inifile for UIA wrappers having the configuration defaults
; Debug=true Turn debugging on of off with true/false value
; Highlight=true Turn Highlighting rectangle to true / false
; TODO: AutoStartSUT=true AutoStartSUT is starting all SUT's automatically
[Global]
Debug=true
Highlight=true
AutoStartSUT=true
[Multiuser]
CFGPerUser=false
[Folders]
subfolders=false
;System under test settings
; Folder = Location where exe can be found
; Workingdir = Location of the working directory
; exe = Name of the exe to start
; Fullname = Path & name of exe
; Windowstate = minimized, maximized, normal
[SUT1]
Folder=%Windowsdir%\system32
Workingdir=%Windowsdir%\system32
exe=calc.exe
Fullname=%Windowsdir%\system32\calc.exe
Parameters=
Processname=calc.exe
Windowstate=normal
[SUT2]
Folder=%Windowsdir%\system32
Workingdir=%Windowsdir%\system32
exe=notepad.exe
Fullname=%Windowsdir%\system32\notepad.exe
Parameters=
Processname=notepad.exe
Windowstate=normal
[SUT3]
C:\Program Files (x86)
Folder=%programfilesdir%\Microsoft Office\Office14
Workingdir=%programfilesdir%\Microsoft Office\Office14
exe=winword.exe
Fullname=%programfilesdir%\Microsoft Office\Office14\winword.exe
Parameters=
Processname=winword.exe
Windowstate=normal