taskswinrar5.0

winrar5.0  时间:2021-05-24  阅读:()
pywinautoDocumentationRelease0.
6.
8ThepywinautocontributorscommunityJan26,2020Contents1Whatispywinauto11.
1Whatisit11.
2Installation11.
3Manualinstallation11.
4Howdoesitwork21.
5Somesimilartoolsforcomparison21.
6Whywriteyetanotherautomationtooliftherearesomanyoutthere32GettingStartedGuide52.
1GUIObjectsInspection/SpyTools52.
2EntryPointsforAutomation62.
3WindowSpecication62.
4AttributeResolutionMagic72.
5Howtoknowmagicattributenames72.
6Howtodisablemagicattributenames102.
7Lookattheexamples102.
8Automatenotepadatthecommandline113HowTo's133.
1Denitions133.
2HowtospecifyausableApplicationinstance133.
3Howtospecifyadialogoftheapplication143.
4Howtospecifyacontrolonadialog153.
5HowtousepywinautowithapplicationlanguagesotherthanEnglish173.
6Howtodealwithcontrolsthatdonotrespondasexpected(e.
g.
OwnerDrawControls)173.
7HowtoAccesstheSystemTray(akaSysTray,aka'NoticationArea'183.
8COMThreadingModel194WaitingforLongOperations214.
1Applicationmethods214.
2WindowSpecicationmethods214.
3Functionsintimingsmodule214.
4Globaltimingsforallactions224.
5Identifycontrols225RemoteExecutionGuide235.
1WindowsRemoteDesktopfeatures235.
2VNCServersoftware23i5.
3Otherremoteaccesssoftware245.
4Trickstorunautomationonalockedmachine245.
5StartremotescriptusingagentbasedCI245.
6Startremotescriptdirectly246Methodsavailabletoeachdifferentcontroltype276.
1AllControls276.
2Button,CheckBox,RadioButton,GroupBox296.
3ComboBox296.
4Dialog296.
5Edit296.
6Header306.
7ListBox306.
8ListView306.
9PopupMenu316.
10ReBar316.
11Static316.
12StatusBar316.
13TabControl316.
14Toolbar326.
15ToolTips326.
16TreeView326.
17UpDown337Credits358DevNotes378.
1FILELAYOUT378.
2Bestmatching378.
3ATTRIBUTERESOLUTION388.
4WRITINGTODIALOGS399PYWINAUTOTODO's419.
1CLOSED(insomewayortheother)4310ChangeLog4510.
10.
6.
8BugFixes4510.
20.
6.
7BugFixes4510.
30.
6.
6BetterWinForms/Qt5Support,BugFixes4610.
40.
6.
5HandlingPrivileges,AutomationIDforWin32etc.
4610.
50.
6.
4NULLpointeraccessxandenhancements4710.
60.
6.
3Alotofimprovementsandsomeoptimizations4710.
70.
6.
2Morebugxes4910.
80.
6.
1BugxesandoptimizationsforUIAutomationandbeyond4910.
90.
6.
0IntroduceMSUIAutomationsupportandmanymoreimprovements5010.
100.
5.
4BugxesandpartialMFCMenuBarsupport5010.
110.
5.
3BetterUnicodesupportforSetEditText/TypeKeysandmenuitems5010.
120.
5.
2ImproveListView,newmethodsforCPUusage,DPIawareness5110.
130.
5.
1Severalxes,moretests5110.
140.
5.
064-bitPy2/Py3compatibility5210.
150.
4.
0Variouscleanupandbugxes5210.
160.
3.
9Experimental!
NewSendkeys,andvariousxes5310.
170.
3.
8Collectingimprovementsfromlast2years5310.
180.
3.
7MergeofWaitchangesandvariousbugxes/improvements5410.
190.
3.
6bChangesnotdocumentedin0.
3.
6history55ii10.
200.
3.
6ScrollingandTreviewItemClickingadded5510.
210.
3.
5MovedtoMetaclasscontrolwrapping5510.
220.
3.
4Fixedissuewithlatestctypes,speedgains,otherchanges5610.
230.
3.
3Addedsomemethods,andxedsomesmallbugs5610.
240.
3.
2Fixedsetup.
pyandsometypos5610.
250.
3.
1Performancetune-ups5710.
260.
3.
0AddedApplicationdata-nowusefulforlocalizationtesting5710.
270.
2.
5Morerefactoring,moretests5810.
280.
2.
1SmallReleasenumber-bigchanges5910.
290.
2.
0Signicantrefactoring6010.
300.
1.
3Manychanges,fewvisible6110.
310.
1.
2AddReadmeandrollupvariouschanges6110.
320.
1.
1Minorbugxrelease6210.
330.
1.
0InitialRelease6211Sourcecodereference6311.
1BasicUserInputModules6311.
2MainUserModules6511.
3SpecicFunctionality7511.
4ControlsReference7611.
5Pre-suppliedTests11711.
6BackendInternalImplementationmodules12511.
7InternalModules12912Indicesandtables135PythonModuleIndex137iiiivCHAPTER1WhatispywinautoMarkMcMahonandContributors(https://github.
com/pywinauto/pywinauto/graphs/contributors),2006-2018ReleasedundertheBSD3-clauselicense1.
1WhatisitpywinautoisasetofpythonmodulestoautomatetheMicrosoftWindowsGUI.
Atitssimplestitallowsyoutosendmouseandkeyboardactionstowindowsdialogsandcontrols.
1.
2Installationpywinautocanbeinstalledwithpipandconda.
Runpipinstallpywinautoorcondainstall-cconda-forgepywinauto.
1.
3ManualinstallationInstallthefollowingPythonpackages–pyWin32(https://github.
com/mhammond/pywin32/releases)–comtypes(https://github.
com/enthought/comtypes/releases)–six(https://pypi.
python.
org/pypi/six)–(optional)Pillow(https://pypi.
python.
org/pypi/Pillow/2.
7.
0)(tomakescreenshoots)Downloadlatestpywinautofromhttps://github.
com/pywinauto/pywinauto/releasesUnpackandrunpythonsetup.
pyinstallTocheckyouhaveitinstalledcorrectlyRunPython>>>frompywinauto.
applicationimportApplication>>>app=Application(backend="uia").
start("notepad.
exe")>>>app.
UntitledNotepad.
type_keys("%FX")1pywinautoDocumentation,Release0.
6.
81.
4HowdoesitworkThecoreconceptisdescribedintheGettingStartedGuide.
Alotisdonethroughattributeaccess(__getattribute__)foreachclass.
ForexamplewhenyougettheattributeofanApplicationorDialogobjectitlooksforadialogorcontrol(respectively).
myapp.
Notepad#looksforaWindow/Dialogofyourappthathasatitle'similar'#to"Notepad"myapp.
PageSetup.
OK#looksfirstforadialogwithatitlelike"PageSetup"#thenitlooksforacontrolonthatdialogwithatitle#like"OK"Thisattributeresolutionisdelayed(withadefaulttimeout)untilitsucceeds.
Soforexampleifyouselectamenuoptionandthenlookfortheresultingdialoge.
g.
app.
UntitledNotepad.
menu_select("File->SaveAs")app.
SaveAs.
ComboBox5.
select("UTF-8")app.
SaveAs.
edit1.
set_text("Example-utf8.
txt")app.
SaveAs.
Save.
click()Atthe2ndlinetheSaveAsdialogmightnotbeopenbythetimethislineisexecuted.
Sowhathappensisthatwewaituntilwehaveacontroltoresolvebeforeresolvingthedialog.
Atthatpointifwecan'tndaSaveAsdialogwithaComboBox5controlthenwewaitaveryshortperiodoftimeandtryagain,thisisrepeateduptoamaximumtime(currently5seconds!
)Thisistoavoidhavingtousetime.
sleepora"wait"functionexplicitly.
Ifyourapplicationperformslongtimeoperation,newdialogcanappearordisappearlater.
Youcanwaitforitsnewstatelikesoapp.
Open.
Open.
click()#openinglargefileapp.
Open.
wait_not('visible')#makesure"Open"dialogbecameinvisible#waitforupto30secondsuntildata.
txtisloadedapp.
window(title='data.
txt-Notepad').
wait('ready',timeout=30)1.
5SomesimilartoolsforcomparisonPythontools–PyAutoGui(https://github.
com/asweigart/pyautogui)-apopularcross-platformlibrary(hasimage-basedsearch,notext-basedcontrolsmanipulation).
–Lackey(https://github.
com/glitchassassin/lackey)-apurePythonreplacementforSikuli(basedonimagepatternmatching).
–AXUI(https://github.
com/xcgspring/AXUI)-oneofthewrappersaroundMSUIAutomationAPI.
–winGuiAuto(https://github.
com/arkottke/winguiauto)-anothermoduleusingWin32API.
Otherscriptinglanguagetools–(Perl)Win32::GuiTest(http://winguitest.
sourceforge.
net/)–(Ruby)Win32-Autogui(https://github.
com/robertwahler/win32-autogui)-awrapperaroundWin32API.
–(Ruby)RAutomation(https://github.
com/jarmo/RAutomation)-thereare3adapters:Win32API,UIA,AutoIt.
2Chapter1.
WhatispywinautopywinautoDocumentation,Release0.
6.
8Otherfreetools–(C#)Winium.
Desktop(https://github.
com/2gis/Winium.
Desktop)-ayoungbutgoodMSUIAutomationbasedtool.
–(C#)TestStack.
White(https://github.
com/TestStack/White)-anothergoodMSUIAutomationbasedli-brarywithalonghistory.
–AutoIt(http://www.
autoitscript.
com/)-freetoolwithitsownBasic-likelanguage(Win32APIbased,no.
NETplans)–AutoHotKey(https://github.
com/Lexikos/AutoHotkey_L/)-nativeC++toolwithitsownscriptinglan-guage(.
ahk)–"Awesometestautomation"list(https://github.
com/atinfo/awesome-test-automation)onGitHub–Abiglistofopensourcetoolsforfunctionaltesting(http://www.
opensourcetesting.
org/category/functional/)Commercialtools–WinRunner(http://www.
mercury.
com/us/products/quality-center/functional-testing/winrunner/)–SilkTest(http://www.
segue.
com/products/functional-regressional-testing/silktest.
asp)–ManyOthers(http://www.
testingfaqs.
org/t-gui.
html)1.
6WhywriteyetanotherautomationtooliftherearesomanyoutthereThereareloadsofreasons:-)Takesadifferentapproach:Mostothertoolsarenotobjectorientedyouendupwritingstufflike:window=findwindow(title="Untitled-Notepad",class="Notepad")SendKeys(window,"%OF")#Format->Fontfontdialog=findwindow("title="Font")buttonClick(fontdialog,"OK")Iwashopingtocreatesomethingmoreuserfriendly(andpythonic).
Forexamplethetranslationofabovewouldbe:win=app.
UntitledNotepadwin.
menu_select("Format->Font")app.
Font.
OK.
click()Pythonmakesiteasy:Pythonisagreatprogramminglanguage,buttherearenoautomationtoolsthatwerePythonic(theveryfewlibrarieswereimplementedinPython).
Localizationasamainrequirement:Mark:"IworkinthelocalizationindustryandGUIautomationisusedextensivelyasoftenallyouneedtodoisensurethatyourUIbehavesandiscorrectwithrespecttotheSourceUI.
ThisisactuallyaneasierjobthenfortestingtheoriginalsourceUI.
Butmostautomationtoolsarebasedoffofcoordinatesortextofthecontrolsandthesecanchangeinthelocalizedsoftware.
Somygoal(thoughnotyetimplemented)istoallowscriptstorununchangedbetweenoriginalsourcelanguage(oftenEnglish)andthetranslatedsoftware(Japanese,German,etc).
"1.
6.
Whywriteyetanotherautomationtooliftherearesomanyoutthere3pywinautoDocumentation,Release0.
6.
84Chapter1.
WhatispywinautoCHAPTER2GettingStartedGuideOnceyouhaveinstalledpywinauto-howdoyougetgoingTheveryrstnecessarythingistodeterminewhichaccessibilitytechnology(pywinauto'sbackend)couldbeusedforyourapplication.
ThelistofsupportedaccessibilitytechnologiesonWindows:Win32API(backend="win32")-adefaultbackendfornow–MFC,VB6,VCL,simpleWinFormscontrolsandmostoftheoldlegacyappsMSUIAutomation(backend="uia")–WinForms,WPF,Storeapps,Qt5,browsersNotes:Chromerequires--force-renderer-accessibilitycmdagbeforestarting.
CustompropertiesandcontrolsarenotsupportedbecauseofcomtypesPythonlibraryrestrictions.
ATSPIonLinuxandAppleAccessibilityAPIareinthelongtermplanssofar.
2.
1GUIObjectsInspection/SpyToolsIfyou'restillnotsurewhichbackendismostappropriateforyouthentryusingobjectinspection/spytoolsthatareavailableforfree:downloadthemfromGitHubrepogui-inspect-tool(https://github.
com/blackrosezy/gui-inspect-tool).
Spy++isincludedintoMSVisualStudiodistribution(evenExpressorCommunity)andisaccessiblethroughStartmenu.
ItusesWin32API.
ItmeansifSpy++canshowallthecontrolsthe"win32"backendiswhatyouneed.
AutoItWindowInfotoolisakindofSpy++clone.
Inspect.
exeisanothergreattoolcreatedbyMicrosoft.
It'sincludedintoWindowsSDKsothatitcanbefoundinthefollowinglocationonx64Windows:C:\ProgramFiles(x86)\WindowsKits\\bin\x64SwitchInspect.
exeintoUIAmode(usingMSUIAutomation).
IfitcanshowmorecontrolsandtheirpropertiesthanSpy++,probablythe"uia"backendisyourchoice.
py_inspect(https://github.
com/pywinauto/py_inspect)isaprototypeofmulti-backendspytoolbasedonpy-winauto.
Switchingbetweenavailablebackendscanshowyouadifferenceinhierarchieswith"win32"and"uia"backends.
py_inspectisafuturereplacementofSWAPY(https://github.
com/pywinauto/SWAPY)whichsupports"win32"backendonlyatthemomentwhenpywinauto==0.
5.
4wasout.
Initialimplementationofpy_inspectcontainsjustabout150linesofcodethankstomodernpywinauto0.
6.
0+architecture.
Ifsomeorallcontrolsarenotvisibletoalltheinspectiontoolsit'sstillpossibletocontroltheapplicationbygeneratingmouseandkeyboardeventsusingbasicmodulesmouseandkeyboard.
5pywinautoDocumentation,Release0.
6.
82.
2EntryPointsforAutomationSoyouhaveanapplication,youknowitsupportsoneofthementionedaccessibilitytechnologies.
What'sthenextFirstyoushouldstartyourapplicationorconnecttoanexistingappinstance.
ItcanbedonewithanApplicationobject.
Thisisnotjustacloneofsubprocess.
Popen,butanentrypointforfurtherautomationlimitingallthescopebyprocessboundaries.
It'susefultocontrolpotentiallyfewinstancesofanapplication(youworkwithoneinstancenotbotheringanotherones).
frompywinauto.
applicationimportApplicationapp=Application(backend="uia").
start('notepad.
exe')#describethewindowinsideNotepad.
exeprocessdlg_spec=app.
UntitledNotepad#waittillthewindowisreallyopenactionable_dlg=dlg_spec.
wait('visible')Ifyouwanttonavigateacrossprocessboundaries(sayWin10Calculatorsurprisinglydrawsitswidgetsinmorethanoneprocess)yourentrypointisaDesktopobject.
fromsubprocessimportPopenfrompywinautoimportDesktopPopen('calc.
exe',shell=True)dlg=Desktop(backend="uia").
Calculatordlg.
wait('visible')ApplicationandDesktopobjectsarebothbackend-specic.
Noneedtousebackendnameinfurtheractionsexplicitly.
2.
3WindowSpecicationIt'sacoreconceptforthehighlevelpywinautoAPI.
Youareabletodescribeanywindoworcontrolapproximatelyorinmoredetailsevenifitdoesn'texistyetoralreadyclosed.
Windowspecicationalsokeepsinformationaboutmatching/searchalgorithmthatwillbeusedtogetarealwindoworcontrol.
Let'screateadetailedwindowspecication:>>>dlg_spec=app.
window(title='Untitled-Notepad')>>>dlg_spec>>>dlg_spec.
wrapper_object()Actualwindowlookupisperformedbywrapper_object()method.
Itreturnssomewrapperfortherealexistingwindow/controlorraisesElementNotFoundError.
Thiswrappercandealwiththewindow/controlbysendingactionsorretrievingdata.
ButPythoncanhidethiswrapper_object()callsothatyouhavemorecompactcodeinproduction.
Thefollow-ingstatementsdoabsolutelythesame:dlg_spec.
wrapper_object().
minimize()#whiledebuggingdlg_spec.
minimize()#inproductionTherearemanypossiblecriteriaforcreatingwindowspecications.
Thesearejustafewexamples.
6Chapter2.
GettingStartedGuidepywinautoDocumentation,Release0.
6.
8#canbemulti-levelapp.
window(title_re='.
*-Notepad$').
window(class_name='Edit')#cancombinecriteriadlg=Desktop(backend="uia").
Calculatordlg.
window(auto_id='num8Button',control_type='Button')Thelistofpossiblecriteriacanbefoundinthepywinauto.
findwindows.
find_elements()function.
2.
4AttributeResolutionMagicPythonsimpliescreatingwindowspecicationbyresolvingobjectattributesdynamically.
Butanattibutenamehasthesamelimitationsasanyvariablename:nospaces,commasandotherspecialsymbols.
Butfortunatelypywinautouses"bestmatch"algorithmtomakealookupresistanttotyposandsmallvariations.
app.
UntitledNotepad#isequivalenttoapp.
window(best_match='UntitledNotepad')Unicodecharactersandspecialsymbolsusageispossiblethroughanitemaccessinadictionarylikemanner.
app['Untitled-Notepad']#isthesameasapp.
window(best_match='Untitled-Notepad')2.
5HowtoknowmagicattributenamesThereareseveralprincipleshow"bestmatch"goldnamesareattachedtothecontrols.
Soifawindowspecicationisclosetooneofthesenamesyouwillhaveasuccessfulnamematching.
1.
Bytitle(windowtext,name):app.
Properties.
OK.
click()2.
Bytitleandcontroltype:app.
Properties.
OKButton.
click()3.
Bycontroltypeandnumber:app.
Properties.
Button3.
click()(Note:Button0andButton1matchthesamebutton,Button2isthenextetc.
)4.
Bytop-leftlabelandcontroltype:app.
OpenDialog.
FileNameEdit.
set_text("")5.
Bycontroltypeanditemtext:app.
Properties.
TabControlSharing.
select("General")Oftennotallofthesematchingnamesareavailablesimultaneously.
Tocheckthesenamesforspecieddia-logyoucanuseprint_control_identifiers()method.
Possible"best_match"namesaredisplayedasaPythonlistforeverycontrolinatree.
Moredetailedwindowspecicationcanalsobejustcopiedfromthemethodoutput.
Sayapp.
Properties.
child_window(title="Contains:",auto_id="13087",control_type="Edit").
>>>app.
Properties.
print_control_identifiers()ControlIdentifiers:Dialog-'WindowsNTProperties'(L688,T518,R1065,B1006)[u'WindowsNTPropertiesDialog',u'Dialog',u'WindowsNTProperties']child_window(title="WindowsNTProperties",control_type="Window")||Image-''(L717,T589,R749,B622)2.
4.
AttributeResolutionMagic7pywinautoDocumentation,Release0.
6.
8|[u'',u'0',u'Image1',u'Image0','Image',u'1']|child_window(auto_id="13057",control_type="Image")||Image-''(L717,T630,R1035,B632)|['Image2',u'2']|child_window(auto_id="13095",control_type="Image")||Edit-'Foldername:'(L790,T596,R1036,B619)|[u'3','Edit',u'Edit1',u'Edit0']|child_window(title="Foldername:",auto_id="13156",control_type="Edit")||Static-'Type:'(L717,T643,R780,B658)|[u'Type:Static',u'Static',u'Static1',u'Static0',u'Type:']|child_window(title="Type:",auto_id="13080",control_type="Text")||Edit-'Type:'(L790,T643,R1036,B666)|[u'4','Edit2',u'Type:Edit']|child_window(title="Type:",auto_id="13059",control_type="Edit")||Static-'Location:'(L717,T669,R780,B684)|[u'Location:Static',u'Location:',u'Static2']|child_window(title="Location:",auto_id="13089",control_type="Text")||Edit-'Location:'(L790,T669,R1036,B692)|['Edit3',u'Location:Edit',u'5']|child_window(title="Location:",auto_id="13065",control_type="Edit")||Static-'Size:'(L717,T695,R780,B710)|[u'Size:Static',u'Size:',u'Static3']|child_window(title="Size:",auto_id="13081",control_type="Text")||Edit-'Size:'(L790,T695,R1036,B718)|['Edit4',u'6',u'Size:Edit']|child_window(title="Size:",auto_id="13064",control_type="Edit")||Static-'Sizeondisk:'(L717,T721,R780,B736)|[u'Sizeondisk:',u'Sizeondisk:Static',u'Static4']|child_window(title="Sizeondisk:",auto_id="13107",control_type="Text")||Edit-'Sizeondisk:'(L790,T721,R1036,B744)|['Edit5',u'7',u'Sizeondisk:Edit']|child_window(title="Sizeondisk:",auto_id="13106",control_type="Edit")||Static-'Contains:'(L717,T747,R780,B762)|[u'Contains:1',u'Contains:0',u'Contains:Static',u'Static5',u'Contains:']|child_window(title="Contains:",auto_id="13088",control_type="Text")||Edit-'Contains:'(L790,T747,R1036,B770)|[u'8','Edit6',u'Contains:Edit']|child_window(title="Contains:",auto_id="13087",control_type="Edit")||Image-'Contains:'(L717,T773,R1035,B775)|[u'Contains:Image','Image3',u'Contains:2']|child_window(title="Contains:",auto_id="13096",control_type="Image")||Static-'Created:'(L717,T786,R780,B801)|[u'Created:',u'Created:Static',u'Static6',u'Created:1',u'Created:0']|child_window(title="Created:",auto_id="13092",control_type="Text")8Chapter2.
GettingStartedGuidepywinautoDocumentation,Release0.
6.
8||Edit-'Created:'(L790,T786,R1036,B809)|[u'Created:Edit','Edit7',u'9']|child_window(title="Created:",auto_id="13072",control_type="Edit")||Image-'Created:'(L717,T812,R1035,B814)|[u'Created:Image','Image4',u'Created:2']|child_window(title="Created:",auto_id="13097",control_type="Image")||Static-'Attributes:'(L717,T825,R780,B840)|[u'Attributes:Static',u'Static7',u'Attributes:']|child_window(title="Attributes:",auto_id="13091",control_type="Text")||CheckBox-'Read-only(Onlyappliestofilesinfolder)'(L790,T825,R1035,B841)|[u'CheckBox0',u'CheckBox1','CheckBox',u'Read-only(Onlyappliestofilesinfolder)Check|child_window(title="Read-only(Onlyappliestofilesinfolder)",auto_id="13075",control_||CheckBox-'Hidden'(L790,T848,R865,B864)|['CheckBox2',u'HiddenCheckBox',u'Hidden']|child_window(title="Hidden",auto_id="13076",control_type="CheckBox")||Button-'Advanced.
.
.
'(L930,T845,R1035,B868)|[u'Advanced.
.
.
',u'Advanced.
.
.
Button','Button',u'Button1',u'Button0']|child_window(title="Advanced.
.
.
",auto_id="13154",control_type="Button")||Button-'OK'(L814,T968,R889,B991)|['Button2',u'OK',u'OKButton']|child_window(title="OK",auto_id="1",control_type="Button")||Button-'Cancel'(L895,T968,R970,B991)|['Button3',u'CancelButton',u'Cancel']|child_window(title="Cancel",auto_id="2",control_type="Button")||Button-'Apply'(L976,T968,R1051,B991)|['Button4',u'ApplyButton',u'Apply']|child_window(title="Apply",auto_id="12321",control_type="Button")||TabControl-''(L702,T556,R1051,B962)|[u'10',u'TabControlSharing',u'TabControlPreviousVersions',u'TabControlSecurity',u'TabC|child_window(auto_id="12320",control_type="Tab")||||TabItem-'General'(L704,T558,R753,B576)||[u'GeneralTabItem','TabItem',u'General',u'TabItem0',u'TabItem1']||child_window(title="General",control_type="TabItem")||||TabItem-'Sharing'(L753,T558,R801,B576)||[u'Sharing',u'SharingTabItem','TabItem2']||child_window(title="Sharing",control_type="TabItem")||||TabItem-'Security'(L801,T558,R851,B576)||[u'Security','TabItem3',u'SecurityTabItem']||child_window(title="Security",control_type="TabItem")||||TabItem-'PreviousVersions'(L851,T558,R947,B576)||[u'PreviousVersionsTabItem',u'PreviousVersions','TabItem4']||child_window(title="PreviousVersions",control_type="TabItem")||||TabItem-'Customize'(L947,T558,R1007,B576)2.
5.
Howtoknowmagicattributenames9pywinautoDocumentation,Release0.
6.
8||[u'CustomizeTabItem','TabItem5',u'Customize']||child_window(title="Customize",control_type="TabItem")||TitleBar-'None'(L712,T521,R1057,B549)|['TitleBar',u'11']||||Menu-'System'(L696,T526,R718,B548)||[u'System0',u'System',u'System1',u'Menu',u'SystemMenu']||child_window(title="System",auto_id="MenuBar",control_type="MenuBar")||||||MenuItem-'System'(L696,T526,R718,B548)|||[u'System2',u'MenuItem',u'SystemMenuItem']|||child_window(title="System",control_type="MenuItem")||||Button-'Close'(L1024,T519,R1058,B549)||[u'CloseButton',u'Close','Button5']||child_window(title="Close",control_type="Button")2.
6HowtodisablemagicattributenamesInsomecases,youmightpreferdisablethemagiclookupsystem,sothatPywinautoimmediatelyraisesifyouaccessanattributewhichexistsneitherontheWindowSpecicationobject,norontheunderlyingelement-wrapperobject.
Indeed,bydefault,Pywinautowilladdyourattributenametothesearchsystem,andwillonlyfailonasubsequentattributeaccessormethodcall.
Inthiscase,turnofftheallow_magic_lookupargumentofyourDesktoporApplicationinstance:desktop=Desktop(backend='win32',allow_magic_lookup=False)or:app=Application(allow_magic_lookup=False)ThisagwillautomaticallybepropagatedtogeneratedWindowSpecicationobjects.
2.
7LookattheexamplesThefollowingexamplesareincluded:Note:Examplesarelanguagedependent-theywillonlyworkonthelanguageofproductthattheywereprogrammedfor.
AllexampleshavebeenprogrammedforEnglishSoftwareexceptwherehighlighted.
mspaint.
pyControlMSPaintnotepad_fast.
pyUsefasttimingsettingstocontrolNotepadnotepad_slow.
pyUseslowtimingsettingstocontrolNotepadnotepad_item.
pyUseitemratherthenattributeaccesstocontrolNotepad.
misc_examples.
pyShowsomeexceptionsandhowtogetcontrolidentiers.
save_from_internet_explorer.
pySaveaWebPagefromInternetExplorer.
save_from_firefox.
pySaveaWebPagefromFirefox.
get_winrar_info.
pyExampleofhowtodomultilingualautomation.
Thisisnotanidealexample(worksonFrench,CzechandGermanWinRar)10Chapter2.
GettingStartedGuidepywinautoDocumentation,Release0.
6.
8forte_agent_sample.
pyExampleofdealingwithacomplexapplicationthatisquitedynamicandgivesdifferentdialogsoftenwhenstarting.
windowmediaplayer.
pyJustanotherexample-dealswithcheckboxesinaListView.
test_sakura.
py,test_sakura2.
pyTwoexamplesofautomatingaJapanaseproduct.
2.
8AutomatenotepadatthecommandlinePleasendbelowasamplerunC:\>pythonPython2.
4.
2(#67,Sep282005,12:41:11)[MSCv.
131032bit(Intel)]onwin32Type"help","copyright","credits"or"license"formoreinformation.
(1)>>>frompywinautoimportapplication(2)>>>app=application.
Application()(3)>>>app.
start("Notepad.
exe")(4)>>>app.
UntitledNotepad.
draw_outline()(5)>>>app.
UntitledNotepad.
menu_select("Edit->Replace")(6)>>>app.
Replace.
print_control_identifiers()ControlIdentifiers:Dialog-'Replace'(L179,T174,R657,B409)['ReplaceDialog','Dialog','Replace']child_window(title="Replace",class_name="#32770")||Static-'Fi&ndwhat:'(L196,T230,R292,B246)|['Fi&ndwhat:Static','Fi&ndwhat:','Static','Static0','Static1']|child_window(title="Fi&ndwhat:",class_name="Static")||Edit-''(L296,T226,R524,B250)|['Fi&ndwhat:Edit','Edit','Edit0','Edit1']|child_window(class_name="Edit")||Static-'Re&placewith:'(L196,T264,R292,B280)|['Re&placewith:','Re&placewith:Static','Static2']|child_window(title="Re&placewith:",class_name="Static")||Edit-''(L296,T260,R524,B284)|['Edit2','Re&placewith:Edit']|child_window(class_name="Edit")||CheckBox-'Match&wholewordonly'(L198,T304,R406,B328)|['CheckBox','Match&wholewordonlyCheckBox','Match&wholewordonly','CheckBox0','C|child_window(title="Match&wholewordonly",class_name="Button")||CheckBox-'Match&case'(L198,T336,R316,B360)|['CheckBox2','Match&case','Match&caseCheckBox']|child_window(title="Match&case",class_name="Button")||Button-'&FindNext'(L536,T220,R636,B248)|['&FindNext','&FindNextButton','Button','Button0','Button1']|child_window(title="&FindNext",class_name="Button")||Button-'&Replace'(L536,T254,R636,B282)|['&ReplaceButton','&Replace','Button2']2.
8.
Automatenotepadatthecommandline11pywinautoDocumentation,Release0.
6.
8|child_window(title="&Replace",class_name="Button")||Button-'Replace&All'(L536,T288,R636,B316)|['Replace&AllButton','Replace&All','Button3']|child_window(title="Replace&All",class_name="Button")||Button-'Cancel'(L536,T322,R636,B350)|['CancelButton','Cancel','Button4']|child_window(title="Cancel",class_name="Button")||Button-'&Help'(L536,T362,R636,B390)|['&Help','&HelpButton','Button5']|child_window(title="&Help",class_name="Button")||Static-''(L196,T364,R198,B366)|['ReplaceStatic','Static3']|child_window(class_name="Static")(7)>>>app.
Replace.
Cancel.
click()(8)>>>app.
UntitledNotepad.
Edit.
type_keys("HifromPythoninteractiveprompt%s"%str(dir()),wit(9)>>>app.
UntitledNotepad.
menu_select("File->Exit")(10)>>>app.
Notepad.
DontSave.
click()>>>1.
Importthepywinauto.
applicationmodule(usuallytheonlymoduleyouneedtoimportdirectly)2.
CreateanApplicationinstance.
Allaccesstotheapplicationisdonethroughthisobject.
3.
WehavecreatedanApplicationinstanceinstep2butwedidnotsupplyanyinformationontheWindowsappli-cationitreferredto.
Byusingthestart()methodweexecutethatapplicationandconnectittotheApplicationinstanceapp.
4.
DrawagreenrectanglearoundtheNotepaddialog-sothatweknowwehavethecorrectwindow.
5.
SelecttheReplaceitemfromtheEditMenuontheNotepadDialogoftheapplicationthatappisconnectedto.
ThisactionwillmaketheReplacedialogappear.
6.
PrinttheidentiersforthecontrolsontheReplacedialog,forexamplethe1steditcontrolontheReplacedialogcanbereferredtobyanyofthefollowingidentiers:app.
Replace.
Editapp.
Replace.
Edit0app.
Replace.
Edit1app.
FindwhatEditThelastistheonethatgivestheuserreadingthescriptaftewardsthebestideaofwhatthescriptdoes.
7.
ClosetheReplacedialog.
(Inascriptleitissafertouseclose_click()ratherthanclick()becauseclose_click()waitsalittlelongertogivewindowstimetoclosethedialog.
)8.
Let'stypesometextintotheNotepadtextarea.
Withoutthewith_spacesargumentspaceswouldnotbetyped.
PleaseseedocumentationforSendKeysforthismethodasitisathinwrapperaroundSendKeys.
9.
AsktoexitNotepad10.
Wewillbeaskedifwewanttosave-clickonthe"No"button.
12Chapter2.
GettingStartedGuideCHAPTER3HowTo's3.
1DenitionsSomeimportantdetionsmaybehelpfulforbeginners.
DialogisawindowcontainingseveralotherGUIelements/controlslikebuttons,editboxesetc.
Dialogisnotnecessarilyamainwindow.
Messageboxontopofmainformisalsoadialog.
Mainformisalsoconsideredadialogbypywinauto.
AcontrolisGUIelementatanylevelofahierarchy.
Thisdenitionincludeswindow,button,editbox,grid,gridcell,baretc.
Win32APItechnology("win32"backendinpywinauto)providesanidentierforeverycontrol.
Thisisauniqueintegercalledhandle.
UIAutomationAPI("uia"backendinpywinauto)maynotprovidewindowhandleforeveryGUIel-ement.
Suchanelementisnotvisibleto"win32"backend.
ButInspect.
execanshowpropertyNativeWindowHandleifit'savailable.
3.
2HowtospecifyausableApplicationinstanceAnApplication()instanceisthepointofcontactforallworkwiththeapplicationyouareautomating.
SotheApplicationinstanceneedstobeconnectedtoaprocess.
Therearetwowaysofdoingthis:start(self,cmd_line,timeout=app_start_timeout)#instancemethod:or:connect(self,**kwargs)#instancemethod:start()isusedwhentheapplicationisnotrunningandyouneedtostartit.
Useitinthefollowingway:app=Application().
start(r"c:\path\to\your\application-a-n-y--arguments")Thetimeoutparameterisoptional,itshouldonlybenecessarytouseiftheapplicationtakesalongtimetostartup.
connect()isusedwhentheapplicationtobeautomatedisalreadylaunched.
Tospecifyanalreadyrunningappli-cationyouneedtospecifyoneofthefollowing:processtheprocessidoftheapplication,e.
g.
app=Application().
connect(process=2341)13pywinautoDocumentation,Release0.
6.
8handleThewindowshandleofawindowoftheapplication,e.
g.
app=Application().
connect(handle=0x010f0c)pathThepathoftheexecutableoftheprocess(GetModuleFileNameExisusedtondthepathofeachprocessandcomparedagainstthevaluepassedin)e.
g.
app=Application().
connect(path=r"c:\windows\system32\notepad.
exe")oranycombinationoftheparametersthatspecifyawindow,thesegetpassedtothepywinauto.
findwindows.
find_elements()function.
e.
g.
app=Application().
connect(title_re=".
*Notepad",class_name="Notepad")Note:Theapplicationhastobereadybeforeyoucanuseconnect*().
Thereisnotimeoutorretrieslikethereiswhenndingtheapplicationafterstart().
Soifyoustarttheapplicationoutsideofpywinautoyouneedtoeithersleeporprogramawaitlooptowaituntiltheapplicationhasfullystarted.
3.
3HowtospecifyadialogoftheapplicationOncetheapplicationinstanceknowswhatapplicationitisconnectedtoadialogtoworkonneedstobespecied.
Therearemanydifferentwaysofdoingthis.
Themostcommonwillbeusingitemorattributeaccesstoselectadialogbasedonit'stitle.
e.
gdlg=app.
Notepadorequivalentlydlg=app['Notepad']Thenexteasiestmethodistoaskforthetop_window()e.
g.
dlg=app.
top_window()ThiswillreturnthewindowthathasthehighestZ-Orderofthetop-levelwindowsoftheapplication.
Note:ThisiscurrentlyfairlyuntestedsoIamnotsureitwillreturnthecorrectwindow.
Itwilldenitelybeatoplevelwindowoftheapplication-itjustmightnotbetheonehighestintheZ-Order.
Ifthisisnotenoughcontrolthenyoucanusethesameparametersascanbepassedtofindwindows.
find_windows()e.
g.
dlg=app.
window(title_re="PageSetup",class_name="#32770")Finallytohavethemostcontrolyoucanusedialogs=app.
windows()thiswillreturnalistofallthevisible,enabled,toplevelwindowsoftheapplication.
Youcanthenusesomeofthemethodsinhandlepropsmoduleselectthedialogyouwant.
Onceyouhavethehandleyouneedthenuseapp.
window(handle=win)Note:Ifthetitleofthedialogisverylong-thenattributeaccessmightbeverylongtotype,inthosecasesitisusuallyeasiertouseapp.
window(title_re=".
*PartofTitle.
*")14Chapter3.
HowTo'spywinautoDocumentation,Release0.
6.
83.
4HowtospecifyacontrolonadialogThereareanumberofwaystospecifyacontrol,thesimplestareapp.
dlg.
controlapp['dlg']['control']The2ndisbetterfornonEnglishOS'swhereyouneedtopassunicodestringse.
g.
app[u'yourdlgtitle'][u'yourctrltitle']Thecodebuildsupmultipleidentiersforeachcontrolfromthefollowing:titlefriendlyclasstitle+friendlyclassIfthecontrol'stitletextisempty(afterremovingnoncharcharacters)thistextisnotused.
Insteadwelookfortheclosesttitletextaboveandtotherightofthecontrol.
Andappendthefriendlyclass.
Sothelistbecomesfriendlyclassclosesttext+friendlyclassOnceasetofidentiershasbeencreatedforallcontrolsinthedialogwedisambiguatethem.
usetheWindowSpecication.
print_control_identiers()methode.
g.
app.
YourDialog.
print_control_identifiers()SampleoutputButton-Paper(L1075,T394,R1411,B485)'PaperGroupBox''Paper''GroupBox'Static-Si&ze:(L1087,T420,R1141,B433)'SizeStatic''Static''Size'ComboBox-(L1159,T418,R1399,B439)'ComboBox''SizeComboBox'Static-&Source:(L1087,T454,R1141,B467)'Source''Static''SourceStatic'ComboBox-(L1159,T449,R1399,B470)'ComboBox''SourceComboBox'Button-Orientation(L1075,T493,R1171,B584)'GroupBox''Orientation''OrientationGroupBox'Button-P&ortrait(L1087,T514,R1165,B534)'Portrait''RadioButton''PortraitRadioButton'Button-L&andscape(L1087,T548,R1165,B568)'RadioButton''LandscapeRadioButton''Landscape'Button-Margins(inches)(L1183,T493,R1411,B584)'Marginsinches''MarginsinchesGroupBox''GroupBox'Static-&Left:(L1195,T519,R1243,B532)'LeftStatic''Static''Left'Edit-(L1243,T514,R1285,B534)'Edit''LeftEdit'Static-&Right:(L1309,T519,R1357,B532)'Right''Static''RightStatic'Edit-(L1357,T514,R1399,B534)'Edit''RightEdit'Static-&Top:(L1195,T550,R1243,B563)3.
4.
Howtospecifyacontrolonadialog15pywinautoDocumentation,Release0.
6.
8'Top''Static''TopStatic'Edit-(L1243,T548,R1285,B568)'Edit''TopEdit'Static-&Bottom:(L1309,T550,R1357,B563)'BottomStatic''Static''Bottom'Edit-(L1357,T548,R1399,B568)'Edit''BottomEdit'Static-&Header:(L1075,T600,R1119,B613)'Header''Static''HeaderStatic'Edit-(L1147,T599,R1408,B619)'Edit''TopEdit'Static-&Footer:(L1075,T631,R1119,B644)'FooterStatic''Static''Footer'Edit-(L1147,T630,R1408,B650)'Edit''FooterEdit'Button-OK(L1348,T664,R1423,B687)'Button''OK''OKButton'Button-Cancel(L1429,T664,R1504,B687)'Cancel''Button''CancelButton'Button-&Printer.
.
.
(L1510,T664,R1585,B687)'Button''Printer''PrinterButton'Button-Preview(L1423,T394,R1585,B651)'Preview''GroupBox''PreviewGroupBox'Static-(L1458,T456,R1549,B586)'PreviewStatic''Static'Static-(L1549,T464,R1557,B594)'PreviewStatic''Static'Static-(L1466,T586,R1557,B594)'Static''BottomStatic'Thisexamplehasbeentakenfromtest_application.
pyNoteTheidentiersprintedbythismethodhavebeenrunthroughtheprocessthatmakestheidentierunique.
Soifyouhavetwoeditboxes,theywillbothhave"Edit"listedintheiridentiers.
Inrealitythoughtherstonecanbereferedtoas"Edit","Edit0","Edit1"andthe2ndshouldbereferedtoas"Edit2"NoteYoudonothavetobeexact!
.
SaywetakeaninstancefromtheexampleaboveButton-Margins(inches)(L1183,T493,R1411,B584)'Marginsinches''MarginsinchesGroupBox''GroupBox'Let'ssaythatyoudon'tlikeanyoftheseGroupBox-toogeneric,itcouldbeanygroupboxMarginsinchesandMarginsinchesGroupBox-thesejustdon'lookright,itwouldbenicertoleaveoutthe'inches'partWellyouCAN!
Thecodedoesabestmatchontheidentiferyouuseagainstalltheavailableidentiersinthedialog.
Forexampleifyoubreakintothedebuggeryoucanseehowdifferentidentierscanbeused(Pdb)printapp.
PageSetup.
Margins.
window_text()Margins(inches)(Pdb)printapp.
PageSetup.
MarginsGroupBox.
window_text()Margins(inches)Andthiswillalsocaterfortypos.
Thoughyoustillhavetobecarefulasifthereare2similaridentiersinthedialogthetypoyouhaveusedmightbemoresimilartoanothercontrolthantheoneyouwerethinkingof.
16Chapter3.
HowTo'spywinautoDocumentation,Release0.
6.
83.
5HowtousepywinautowithapplicationlanguagesotherthanEn-glishBecausePythondoesnotsupportunicodeidentiersincodeyoucannotuseattributeaccesstoreferenceacontrolsoyouwouldeitherhavetouseitemaccessormakeanexplicitcallstowindow().
Soinsteadofwritingapp.
dialog_ident.
control_ident.
click()Youwouldhavetowriteapp['dialog_ident']['control_ident'].
click()Orusewindow()explictlyapp.
window(title_re="NonAsciiCharacters").
window(title="MoreNonAsciiCharacters").
click()Toseeanexampleofthischeckexamples\misc_examples.
pyget_info()3.
6Howtodealwithcontrolsthatdonotrespondasexpected(e.
g.
OwnerDrawControls)Somecontrols(especiallyOwnerdrawncontrols)donotrespondtoeventsasexpected.
ForexampleifyoulookatanyHLPleandgototheIndexTab(click'Search'button)youwillseealistbox.
RunningSpyorWinspectoronthiswillshowyouthatitisindeedalistbox-butitisownerdrawn.
ThismeansthatthedeveloperhastoldWindowsthattheywilloverridehowitemsaredisplayedanddoitthemselves.
Andinthiscasetheyhavemadeitsothatstringscannotberetrieved:-(.
Sowhatproblemsdoesthiscauseapp.
HelpTopics.
ListBox.
texts()#1app.
HelpTopics.
ListBox.
select("ItemInList")#21.
Willreturnalistofemptystrings,allthismeansisthatpywinautohasnotbeenabletogetthestringsinthelistbox2.
ThiswillfailwithanIndexErrorbecausetheselect(string)methodofaListBoxlooksfortheitemintheTextstoknowtheindexoftheitemthatitshouldselect.
Thefollowingworkaroundwillworkonthiscontrolapp.
HelpTopics.
ListBox.
select(1)Thiswillselectthe2nditeminthelistbox,becauseitisnotastringlookupitworkscorrectly.
Unfortunatelynoteventhiswillalwayswork.
ThedevelopercanmakeitsothatthecontroldoesnotrespondtostandardeventslikeSelect.
InthiscasetheonlywayyoucanselectitemsinthelistboxisbyusingthekeyboardsimulationofTypeKeys().
Thisallowsyoutosendanykeystrokestoacontrol.
Sotoselectthe3rditemyouwoulduseapp.
Helptopics.
ListBox1.
type_keys("{HOME}{DOWN2}{ENTER}"){HOME}willmakesurethattherstitemishighlighted.
{DOWN2}willthenmovethehighlightdowntwoitems3.
5.
HowtousepywinautowithapplicationlanguagesotherthanEnglish17pywinautoDocumentation,Release0.
6.
8{ENTER}willselectthehighlighteditemIfyourapplicationmadeanextensiveuseofasimilarcontroltypethenyoucouldmakeusingiteasierbyderivinganewclassfromListBox,thatcoulduseextraknowledgeaboutyourparticularapplication.
ForexampleintheWinHelpexampleeverytimeanitemishighlightedinthelistview,itstextisinsertedintotheEditcontrolabovethelist,andyouCANgetthetextoftheitemfromtheree.
g.
#printthetextoftheitemcurrentlyselectedinthelistbox#(aslongasyouarenottypingintotheEditcontrol!
)printapp.
HelpTopics.
Edit.
texts()[1]3.
7HowtoAccesstheSystemTray(akaSysTray,aka'NoticationArea')Neartheclockthereareiconsrepresentingrunningapplications,thisareaisnormallyreferredtoasthe"SystemTray".
Infact,therearemanydifferentwindows/controlsinthisarea.
Thecontrolthatcontainstheiconsisactuallyatoolbar.
ItisachildofPagercontrolwithinawindowwithaclassTrayNotifyWnd,whichisinsideanotherwindowwithaclassShell_TrayWndandallthesewindowsarepartoftherunningExplorerinstance.
Thankfullyyoudon'tneedtorememberallthat:-).
Thethingthatisimportanttorememberisthatyouarelookingforawindowinthe"Explorer.
exe"applicationwiththeclass"Shell_TrayWnd"thathasToolbarcontrolwithatitle"NoticationArea".
Onewaytogetthisistodothefollowingimportpywinauto.
applicationapp=pywinauto.
application.
Application().
connect(path="explorer")systray_icons=app.
ShellTrayWnd.
NotificationAreaToolbarThetaskbarmoduleprovidesverypreliminaryaccesstotheSystemTray.
Itdenesthefollowingvariables:explorer_appdenesanApplication()objectconnectedtotherunningexplorer.
Youprobablydon'tneedtouseitdirectlyverymuch.
TaskBarThehandletothetaskbar(thebarcontainingStartButton,theQuickLaunchicons,runningtasks,etcStartButton"Startmeup":-)Ithinkyoumightknowwhatthisis!
QuickLaunchTheToolbarwiththequicklaunchiconsSystemTrayThewindowthatcontainstheClockandSystemTrayIconsClockTheclockSystemTrayIconsThetoolbarrepresentingthesystemtrayiconsRunningApplicationsThetoolbarrepresentingtherunningapplicationsIhavealsoprovidedtwofunctionsinthemodulethatcanbeusedtoclickonsystemtrayicons:ClickSystemTrayIcon(button)Youcanusethistoleftclickavisibleiconinthesystemtray.
Ihadtospecicallysayvisibleiconastheremaybemanyinvisibleiconsthatobviouslycannotbeclicked.
Buttoncanbeanyinteger.
Ifyouspecify3thenitwillndandclickthe3rdvisiblebutton.
(Almostnoerrorcheckingisperformednowherebutthismethodwillmorethanlikelybemoved/renamedinthefuture.
)18Chapter3.
HowTo'spywinautoDocumentation,Release0.
6.
8RightClickSystemTrayIcon(button)SimilartoClickSytemTrayIconbutperformsarightclick.
Often,whenyouclick/rightclickonanicon,yougetapopupmenu.
Thethingtorememberatthispointisthatthepopupmenuisapartoftheapplicationbeingautomatednotpartofexplorer.
e.
g.
#connecttooutlookoutlook=Application.
connect(path='outlook.
exe')#clickonOutlook'sicontaskbar.
ClickSystemTrayIcon("MicrosoftOutlook")#Selectaniteminthepopupmenuoutlook.
PopupMenu.
Menu().
get_menu_path("CancelServerRequest")[0].
click()3.
8COMThreadingModelBydefault,pywinautosetsuptheclientMultithreadingCOMmodel(MTA)oninitifnoothermodelwasdenedpriortoimportofpywinauto.
Themodelcanbesetupbyanotherimportedmoduleimplicitlyorspeciedexplicitlythroughsys.
coinit_flags.
ExampleforoverridingMTAbysettingthesinglethreadedappartmentmodelexplicitly.
importsyssys.
coinit_flags=2#COINIT_APARTMENTTHREADEDimportpywinautoNoticethatthenalvalueofCOMmodelisassignedbacktosys.
coinit_flags.
Thisistoavoidconictswithothermodules.
Possiblevaluesforsys.
coinit_flags:0-Multi-ThreadedApartmentmodel(MTA)2-Single-ThreadedApartmentmodel(STA)Moreinfo:AboutMicrosoftCOMthreadingmodels:UnderstandingandUsingCOMThreadingModels(https://msdn.
microsoft.
com/en-us/library/ms809971.
aspx)Internaldiscussion(https://github.
com/pywinauto/pywinauto/issues/394#issuecomment-334926345)onpywin-autoMTA.
3.
8.
COMThreadingModel19pywinautoDocumentation,Release0.
6.
820Chapter3.
HowTo'sCHAPTER4WaitingforLongOperationsAGUIapplicationbehaviourisoftenunstableandyourscriptneedswaitinguntilanewwindowappearsoranexistingwindowisclosed/hidden.
pywinautocanexiblywaitforadialoginitializationimplicitly(withthedefaulttimeout)orexplicitlyusingdedicatedmethods/functionsthatcouldhelpyoutomakeyourcodeeasierandmorereliable.
4.
1Applicationmethodswait_cpu_usage_lower(newinpywinauto0.
5.
2,renamedin0.
6.
0)Thismethodisusefulformulti-threadedinterfacesthatallowalazyinitializationinanotherthreadwhileGUIisresponsiveandallcontrolsalreadyexistandseemsreadytouse.
Sowaitingforaspecicwindowexistence/stateisuseless.
InsuchcasetheCPUusageforthewholeprocessindicatesthatataskcalculationisnotnishedyet.
Example:app.
wait_cpu_usage_lower(threshold=5)#waituntilCPUusageislowerthan5%NOTE:thismethodisavailableforthewholeapplicationprocessonly,notforawindow/element.
4.
2WindowSpecicationmethodsThesemethodsareavailabletoallcontrols.
waitwait_notThereisanexamplecontaininglongwaits:installscriptfor7zip9.
20x64(https://gist.
github.
com/vasily-v-ryabov/7a04717af4584cbb840f).
AWindowSpecificationobjectisn'tnecessarilyrelatedtoanexistingwindow/control.
It'sjustadescriptionnamelyacoupleofcriteriatosearchthewindow.
Thewaitmethod(ifnoanyexceptionisraised)canguaranteethatthetargetcontrolexistsorevenvisible,enabledand/oractive.
4.
3FunctionsintimingsmoduleTherearealsolow-levelmethodsusefulforanyPythoncode.
wait_until21pywinautoDocumentation,Release0.
6.
8wait_until_passesDecoratorspywinauto.
timings.
always_wait_until()andpywinauto.
timings.
always_wait_until_passes(canalsobeusedifeveryfunctioncallshouldhavetimingcontrol.
#callensure_text_changed(ctrl)every2secuntilit'spassedortimeout(4sec)isexpired@always_wait_until_passes(4,2)defensure_text_changed(ctrl):ifprevious_text==ctrl.
window_text():raiseValueError('Thectrltextremainsthesamewhilechangeisexpected')4.
4GlobaltimingsforallactionsManyactionsrequiresomepausebefore,afterandin-between.
Thereareseveralglobalconstantsinmoduletimingsdeningsuchpauses.
Itcanbealignedforyourneedsindividuallybysettingglobalstaticvariablesinobjecttimings.
Timings.
Allglobaltimingscanbesettodefaultatonce,ordoubled,ordividedbytwo:fromtimingsimportTimingsTimings.
defaults()Timings.
slow()#doublealltimings(~2xslowerscriptexecution)Timings.
fast()#dividealltimingsbytwo(~2xfaster)4.
5IdentifycontrolsThemethodstohelpyoutondaneededcontrol.
print_control_identiersdraw_outline4.
5.
1HowTo'sHowTo's22Chapter4.
WaitingforLongOperationsCHAPTER5RemoteExecutionGuideDesktopGUItestsusuallyrequireactivedesktoptomovemousecursorandtypesomekeysintoafocusedwindow.
Thatcompletelyblockslocalmachinefromnormalusage.
Butrunningtestsonaremotemachineisachallenge.
ThisguidecollectedknownissuesandsolutionstocontrolaremotemachinewithGUItests.
5.
1WindowsRemoteDesktopfeaturesRemoteDesktop(RDP)providesvirtualactivedesktoptoremotemachinewithWindowsOS.
Thereare2potentialissues:IfRDPwindowisminimized,thereisnoactivedesktoponremotePCbydefault.
IfRDPisdisconnected,thedesktopislockedout.
InbothcasesanyGUIautomationjobswillfail(ifyoudon'tusesometricksdescribedbelow).
TheworkaroundsarewelldescribedinTestCompletedocumetation:RunningTestsinMinimizedRemoteDesktopWindows(https://support.
smartbear.
com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.
html)DisconnectingFromRemoteDesktopWhileRunningAutomatedTests(https://support.
smartbear.
com/testcomplete/docs/testing-with/running/via-rdp/keeping-computer-unlocked.
html)5.
2VNCServersoftwareThereismoresimplewaytoavoidaboveissues:usingVNCserversoftware(forexample,TightVNC).
Itworksasapairofclientandserver.
VNCserveralsoprovidesactivedesktoponaremotemachine.
Thisisanon-virtualdesktopsoworkingwithnativescreenresolutiononaremotePCmayrequireupdatingvideodrivers.
MinimizingordisconnectingVNCclientdoesn'tdestroyactivedesktop(bydefault!
).
Thisisacross-platformsolution(VNCserverisanativepartofmacOSandavailableonLinux).
Theonlyproblemyoumayfacewith:UsingRemoteDesktop(RDP)maybreakVNCserverbenetsandyouhavetorestartremotePCorapplyRDPworkaroundsdescribedabove.
23pywinautoDocumentation,Release0.
6.
85.
3OtherremoteaccesssoftwareIfanyonetriedtorunGUItests/automationremotelyusingTeamViewer,PowerBIdesktoporanyothervirtualdesktopsoftware,feelfreetoaddmoredetailsintothisguide.
5.
4TrickstorunautomationonalockedmachineForsomeapplicationsit'spossibletorunGUIautomationonalockedmachine,butitrequiresusingspecialmethods.
Firstit'sworthlistingmethodsthatdon'tworkonalockedmachine:click_inputandallothermouseclickandpressmethodsendingwith_input.
set_focusasitusesSetCursorPosandSetForegroundWindow.
type_keysfornativekeyboardinput.
Directusageofmodulesmouseandkeyboard.
Someothermethodsmaynotworkalso,butitdependsonapplication.
Therearefewmethodsforsilenttextinputinbackend="win32":send_chars(symbolsonly;specialkeycombinationsdonotwork)send_keystrokes(somespecialkeycombinationsmaywork)Thereisanotherusefulmethodtoenterstringatonce(availableforbothbackends,usuallyforeditboxonly):"uia":set_edit_text(entertextasis,nomodierssupported)"win32":set_edit_text5.
5StartremotescriptusingagentbasedCIWhenyourscriptisreadyandyoucanrunitonaremotemachinemanually,it'stimetoautomatethelaststep:triggerrunningthescriptfromlocalmachineorfromCIserver.
IfyouhaveinternalhostedCI(forexample,Jenkins),probablytargetmachineisalreadyconnectedtoJenkinsmasterusinganagent.
Therearethreewaystoconnectagent:Runagentasaservice:GUItestswon'tworkinthiscasebecauseGUIcan'tbeevencreatedwhenrunningasaservice.
RunagentthroughSSH:GUItestswon'twork.
Runagentasanormalapplication.
Thisistheonlyworkingcase!
5.
6StartremotescriptdirectlyThischapterisinspiredbyissue#401(https://github.
com/pywinauto/pywinauto/issues/401)(specialthankstoyan-gliang003(https://github.
com/yangliang003)).
FirstoptionisPsExec.
ThankstothispostonStackExchange(https://serverfault.
com/a/852877/368634).
1.
DownloadPsTools(https://docs.
microsoft.
com/en-us/sysinternals/downloads/psexec).
2.
GetprocessIDofRDPsessionusingtasklistcommand.
PowerShellscript:24Chapter5.
RemoteExecutionGuidepywinautoDocumentation,Release0.
6.
8$session=tasklist/foCSV|findstrRDP;$session=$session.
Split(",")[3];$session.
Spl3.
Startprocess:PsExec.
exe-s-i123pythonmy_script.
py.
Ansible(https://github.
com/ansible/ansible)hasPsExecpluginthatsimpliesit.
Playbookexample:----name:testramodulehosts:*****tasks:-name:runGUIautomationwin_psexec:command:pythonpywinauto_example.
pyexecutable:C:\Windows\PSTools\psexec.
exeinteractive:yesusername:adminpassword:******hostnames:******WindowsSchedulerisalsocapabletostartjobswithGUIinteractionsupport.
Thereiseasywaytoschedulethetaskfromcmd.
exeonce:Schtasks/Create/tnmy_task/trc:\temp\my_task.
bat/scONCE/sthh:mi:ss/sdyyyy/mm/dd5.
6.
1HowTo'sHowTo's5.
6.
Startremotescriptdirectly25pywinautoDocumentation,Release0.
6.
826Chapter5.
RemoteExecutionGuideCHAPTER6MethodsavailabletoeachdifferentcontroltypeWindowshavemanycontrols,buttons,lists,etc6.
1AllControlsThesefunctionsareaviailabletoallcontrols.
capture_as_imageclickclick_inputcloseclose_clickdebug_messagedouble_clickdouble_click_inputdrag_mousedraw_outlineget_focusget_show_statemaximizemenu_selectminimizemove_mousemove_windownotify_menu_selectnotify_parentpress_mousepress_mouse_inputrelease_mouse27pywinautoDocumentation,Release0.
6.
8release_mouse_inputrestoreright_clickright_click_inputsend_messagesend_message_timeoutset_focusset_window_texttype_keysChildrenClassClientRectClientRectsContextHelpIDControlIDExStyleFontFontsFriendlyClassNameGetPropertiesHasExStyleHasStyleIsChildIsDialogIsEnabledIsUnicodeIsVisibleMenuMenuItemMenuItemsOwnerParentPopupWindowProcessIDRectangleStyle28Chapter6.
MethodsavailabletoeachdifferentcontroltypepywinautoDocumentation,Release0.
6.
8TextsTopLevelParentUserDataVerifyActionableVerifyEnabledVerifyVisibleWindowText6.
2Button,CheckBox,RadioButton,GroupBoxButtonWrapper.
CheckButtonWrapper.
GetCheckStateButtonWrapper.
SetCheckIndeterminateButtonWrapper.
UnCheck6.
3ComboBoxComboBoxWrapper.
DroppedRectComboBoxWrapper.
ItemCountComboBoxWrapper.
ItemDataComboBoxWrapper.
ItemTextsComboBoxWrapper.
SelectComboBoxWrapper.
SelectedIndex6.
4DialogDialogWrapper.
ClientAreaRectDialogWrapper.
RunTestsDialogWrapper.
WriteToXML6.
5EditEditWrapper.
GetLineEditWrapper.
LineCountEditWrapper.
LineLengthEditWrapper.
SelectEditWrapper.
SelectionIndices6.
2.
Button,CheckBox,RadioButton,GroupBox29pywinautoDocumentation,Release0.
6.
8EditWrapper.
SetEditTextEditWrapper.
set_window_textEditWrapper.
TextBlock6.
6HeaderHeaderWrapper.
GetColumnRectangleHeaderWrapper.
GetColumnTextHeaderWrapper.
ItemCount6.
7ListBoxListBoxWrapper.
GetItemFocusListBoxWrapper.
ItemCountListBoxWrapper.
ItemDataListBoxWrapper.
ItemTextsListBoxWrapper.
SelectListBoxWrapper.
SelectedIndicesListBoxWrapper.
SetItemFocus6.
8ListViewListViewWrapper.
CheckListViewWrapper.
ColumnCountListViewWrapper.
ColumnsListViewWrapper.
ColumnWidthsListViewWrapper.
GetColumnListViewWrapper.
GetHeaderControlListViewWrapper.
GetItemListViewWrapper.
GetSelectedCountListViewWrapper.
IsCheckedListViewWrapper.
IsFocusedListViewWrapper.
IsSelectedListViewWrapper.
ItemCountListViewWrapper.
ItemsListViewWrapper.
SelectListViewWrapper.
Deselect30Chapter6.
MethodsavailabletoeachdifferentcontroltypepywinautoDocumentation,Release0.
6.
8ListViewWrapper.
UnCheck6.
9PopupMenu(noextravisiblemethods)6.
10ReBarReBarWrapper.
BandCountReBarWrapper.
GetBandReBarWrapper.
GetToolTipsControl6.
11Static(noextravisiblemethods)6.
12StatusBarStatusBarWrapper.
BorderWidthsStatusBarWrapper.
GetPartRectStatusBarWrapper.
GetPartTextStatusBarWrapper.
PartCountStatusBarWrapper.
PartRightEdges6.
13TabControlTabControlWrapper.
GetSelectedTabTabControlWrapper.
GetTabRectTabControlWrapper.
GetTabStateTabControlWrapper.
GetTabTextTabControlWrapper.
RowCountTabControlWrapper.
SelectTabControlWrapper.
TabCountTabControlWrapper.
TabStates6.
9.
PopupMenu31pywinautoDocumentation,Release0.
6.
86.
14ToolbarToolbarWrapper.
ButtonToolbarWrapper.
ButtonCountToolbarWrapper.
GetButtonToolbarWrapper.
GetButtonRectToolbarWrapper.
GetToolTipsControlToolbarWrapper.
PressButtonToolbarButton(returnedbyButton())ToolbarButton.
RectangleToolbarButton.
StyleToolbarButton.
click_inputToolbarButton.
ClickToolbarButton.
IsCheckableToolbarButton.
IsCheckedToolbarButton.
IsEnabledToolbarButton.
IsPressableToolbarButton.
IsPressedToolbarButton.
State6.
15ToolTipsToolTipsWrapper.
GetTipToolTipsWrapper.
GetTipTextToolTipsWrapper.
ToolCount6.
16TreeViewTreeViewWrapper.
EnsureVisibleTreeViewWrapper.
GetItemTreeViewWrapper.
GetPropertiesTreeViewWrapper.
IsSelectedTreeViewWrapper.
ItemCountTreeViewWrapper.
RootTreeViewWrapper.
SelectTreeViewElement(returnedbyGetItem()andRoot())TreeViewElement.
Children32Chapter6.
MethodsavailabletoeachdifferentcontroltypepywinautoDocumentation,Release0.
6.
8TreeViewElement.
ItemTreeViewElement.
NextTreeViewElement.
RectangleTreeViewElement.
StateTreeViewElement.
SubElementsTreeViewElement.
Text6.
17UpDownUpDownWrapper.
GetBaseUpDownWrapper.
GetBuddyControlUpDownWrapper.
GetRangeUpDownWrapper.
GetValueUpDownWrapper.
SetValueUpDownWrapper.
IncrementUpDownWrapper.
Decrement6.
17.
UpDown33pywinautoDocumentation,Release0.
6.
834Chapter6.
MethodsavailabletoeachdifferentcontroltypeCHAPTER7Credits(listedinreversechronologicalorder)VasilyRyabov,ValentinKroupkin,AlexanderRumyantsev-MSUIAutomationbackendimplementationIvanMagazinnik-mouse/keyboardinputemulationonLinuxMaximSamokhvalov-initialimplementationofwin32_hooksmoduleIntelCorporation-VasilyRyabovrevivedandmaintainedtheprojectduringhisworkatIntel(pywinauto0.
5.
x)ValentinKroupkin(airelil)-continuousintegration(AppVeyor),manyunittestsimprovements(pywinauto0.
5.
x)MichaelHerrmann-bugxes,projectmaintenance(0.
4.
x)Raghav-ideawithusingmetaclassforndingwrapperDaisukeYamashita-Bugs/suggestionsfor2.
5thatMenuWrapper.
GetProperties()returnsalistratherthenadictDaliusDobravolskas-Helpontheforumsandpromptedmajorimprovementsonthewait*functionalityJeffWinkler-Earlyencouragement,creationofscreencastsStefaanHimpe-Lotsofspeedandstabilityimprovementsearlyon35pywinautoDocumentation,Release0.
6.
836Chapter7.
CreditsCHAPTER8DevNotes8.
1FILELAYOUT#usedbyjustabouteverything(andconsideredablock!
)win32denes.
pywin32functions.
pywin32structures.
py#Findwindowsandtheirattributesndwindows.
pyhandleprops.
py#wrapwindows,getextrainfoforparticularcontrols#setthefriendlyclassnamecontrolscommon_controls.
pycontrolscontrolactions.
pycontrolshwndwrapper.
pycontrolswin32_controls.
py#currentlydependsontheFriendlyclassname#probablyneedstoberefactoredtomakeitindependentofcontrols!
#maybemovethatstuffto_application_ndbestmatch.
py#currentlydependsoncontrols!
controlactions.
pytestsallcontrols.
pytestsasianhotkey.
pytestscomboboxdroppedheight.
pytestscomparetoreffont.
pytestslead-trailspaces.
pytestsmiscvalues.
pytestsmissalignment.
pytestsmissingextrastring.
pytestsoverlapping.
pytestsre-peatedhotkey.
pyteststranslation.
pyteststruncation.
pycontrolproperties.
pyxml_helpers.
pyFindDialog.
pyPyDlgCheckerWrapper.
pyapplication.
pytest_application.
py8.
2BestmatchingdifibprovidesthissupportFormenu'sitissimplewematchagainstthetextofthemenuitem.
Forcontrolsthestoryismorecomplicatedbecausewewanttomatchagainstthefollowing:ControltextifitexistsFriendlyClassnameControltext+Friendlyclassname(ifcontroltextexists)(Possibly)closeststatic+FriendlyClassNamee.
g.
FindWhatCombo,ComboBox1,orText,TextRiadio,RadioButton21.
thecontrolitselfknowswhatitshouldbereferredto37pywinautoDocumentation,Release0.
6.
82.
Needtodisambiguateacrossallcontrolsinthedialog3.
thenweneedtomatch8.
3ATTRIBUTERESOLUTIONThinkingagain.
.
.
app.
dlg.
controlTWOLEVELSapplication.
member(Pythonresolves)anattributeofapplicationobjectapplication.
dialogadialogreferenceTHREELEVELSapplication.
member.
attr(Pythonresolves)anotherattributeofthepreviousmemberapplication.
dialog.
memberamemberofthedialogobjectapplication.
dialog.
controlacontrolonthedialogFOURLEVELS(leavingoutPythonresolved)application.
dialog.
member.
memberapplication.
dialog.
control.
memberDELAYEDRESOLUTIONFORSUCCESSTakingtheexampleapp.
dlg.
control.
action()Ifweleaveoutsyntaxandprogrammingerrorstherearestillanumberofreasonswhyitcouldfail.
dlgmightnotbefoundcontrolmightnotbefoundeitherdlgorcontrolmaybedisableddialogandcontrolmaybefoundbutonthewrongdialog(e.
g.
inNotepadyoucanbringup2"PageSetup"dialogsbothwithanOKbutton)Onesolutionwouldjustbetoadda"sleep"beforetryingtondeachnewdialog(toensurethatitisthereandready)-butthiswillmeanlotsofunnecessarywaiting.
SothesolutionIhavetriedis:performthecompleteattributeaccessresolutionatthelatestpossibletimeifitfailsthenwaitandtryagainafteraspeciedtimeoutfailraisingtheoriginalexception.
Thismeansthatinthenormalcaseyoudon'thaveunnecessarywaits-andinthefailurecase-youstillgetanexceptionwiththeerror.
Alsowaitingtodoresolutionaslateaspossiblestopserrorswhereanearlierpartofthepathsucceedes-butndsthewrongitem.
SoforexampleifndsthepagesetupdialoginNotepad#openthePrintersetupdialog(whichhas"PageSetup"astitle)app.
PageSetup.
Printer.
Click()#ifthisrunstooquicklyitactuallyndsthecurrentpagesetupdialog#beforethenextdialogopens,butthatdialogdoesnothaveaProperties#button-soanerrorisraised.
#becausewere-runtheresolutionfromthestartwendthenewpagesetupdialog.
app.
PageSetup.
Properties.
Click()38Chapter8.
DevNotespywinautoDocumentation,Release0.
6.
88.
4WRITINGTODIALOGSWeneedawayofmakingsurethatthedialogisactivewithouthavingtoaccessacontrolonit.
e.
g.
app.
MainWin.
MenuSelect("SomethingThat->LoadsaDialog")app.
Dlg.
_write("dlg.
xml")oraharderproblem:app.
PageSetup.
Printer.
Click()app.
PageSetup.
_write("pagesetup.
xml")InthissecondexampleitisveryhardtobesurethatthecorrectPageSetupdialogisshown.
Theonlywaytoberealysureistocheckfortheexistanceofcertaincontrol(s)(ID,Class,text,whatever)-butitwouldbenicetonothavetodealwiththose:-(Anotherlessdeclarative(moremagic)istoscanthelistofavailablewindows/controlsandiftheyhaven'tchangedthenacceptthatthecorrectoneisshown.
WhentestingandhavingXMLlesthenweshouldusethosetomakesurethatwehavethecorrectdialogup(byusingClass/ID)8.
4.
WRITINGTODIALOGS39pywinautoDocumentation,Release0.
6.
840Chapter8.
DevNotesCHAPTER9PYWINAUTOTODO'sMakesuretoadddocumentationstringsforallundocumentedmethods/functionsCheckcoverageofthetestsandworktoincreaseit.
AddtestsforSendInputclickmethodsImplementndbestmatchusingFuzzyDict.
Findawayofdoingapplicationdatainabetterway.
Currentlyifsomeoneevenaddsacalltoprint_control_identiers()itwillbreakthematchingalgorithm!
NeedtomovethecheckingifacontrolisaOwnerdrawn/bitmapcontroloutof__init__methodsandintoit'sownmethodsomethinglikeIsNormallyRendered()(Why)GiveexamplehowtoworkwithTrayWindowFixToolbarWrapper.
PressButton()whichdoesn'tseemtowork(foundwileworkingonIEexamplescript)Maybesupplyanoptionsothatscriptscanberunbyusing:pywinauto.
exeyourscript.
pyThiswouldworkbycreatingaPy2exewrapperthatwouldimportthescript(andoptionallycallaparticularfunction)Thiswaypywinautocouldbemadeavailabletopeoplewithoutpythoninstalled(whetherthisisabigrequire-mentornotIdon'tknowbecausetheautomationlanguageispythonanyway!
.
Messagetraps-howtohandleunwantedmessageboxespoppingup1.
WaitforanExceptionthenhandleitthere2.
setatrapwaitingforaspecicdialog3.
oncallstowindowspecication,ifwefailtondourwindowthenwecanrunquicklythroughtheavailablespeciedtrapstoseeifanyofthemapply-theniftheydowecanruntheassociatedactions-thentryouroriginaldialogagainHandleaddingreferencecontrols(inthattheyshouldbethecontrolsusedforndingwindows)Findthereferencenameofavariablee.
gsothatinDialog.
_write()wecanknowthevariablenamethatcalledthe_writeon(thiswedon'thavetorepeattheXMLlename!
)Ifweremovethedelayafterabuttonclickincontrolactionsthentryingtoclosetwodialogsinarowmightfailbecausetherstdialoghasn'tclosedyetandthe2ndmayhavesimilartitleandsameclosingbuttone.
gPageSetup.
OK.
Click(),PageSetup2.
OK.
Click().
Apossiblesolutiontothismightbetokeepacacheofwindowsintheapplicationandnotwodifferentdialogidentiers(PageSetupandPageSetup2inthiscase)canhavethe41pywinautoDocumentation,Release0.
6.
8samehandle-soreturningthehandleofPageSetupwhenwecallPageSetup2wouldfail(andwewoulddoourusualwaitinguntilitsucceedsortimesout).
Investigateusinganyofthefollowing–BringWindowToTop:probablynecessarybeforeimagecapture–GetTopWindow:maybetore-settopwindowaftercapture–EnumThreadWindows–GetGUIThreadInfoMakeiteasytoworkwithcontext(rightclick)menu'sFurthersupport.
NETcontrolsanddownload/createatest.
NETapplicationLookatsupportingtheSytemTray(e.
g.
rightclickonanicon)supplySystemTrayclass(singletonprobably)Lookatclickingandtextinput-maybeuseSendInputSupportUp-DowncontrolsandothercommoncontrolsFindoutwhethercontrol.
item.
action()orcontrol.
action(item)isbetterCreateaRecordertovisuallycreatetestsLOWPRIORITYCreateaclassthatmakesiteasytodealwithasinglewindow(e.
g.
noapplication)Allowappstobestartedinadifferentthreadsowedon'tlockup–thisisbeingdonealready-theproblemisthatsomemessagescannotbesentacrossprocessesiftheyhavepointers(soweneedtosendasynchronousmessagewhichwaitsfortheotherprocesstorespondbeforereturning)–ButIguessitwouldbepossibletocreateathreadforsendingthosemessagesLiberatethecodefromHwndWrapper-thereisverylittlethisadd'sbeyondwhatisavailableinhandleprops.
ThemainreasonthisisrequiredisfortheFriendlyClassName.
SoIneedtolooktoseeifthiscanbemovedelsewhere.
DoingthismightattentheheirarchyquiteabitandreducethedependenciesonthevariouspackagesNeedtomakeMenuitemsintoclassessoinsteadofDlg.
MenuSelectweshouldbedoingdlg.
Menu("blah->blah").
select()orevendlg.
Menu.
Blah.
Blah.
select()Todothisweneedtochangehowmenu'sareretrieved-ratherthangetallmenuitemsatthestart-thenwejustgettherequestedlevel.
Thiswouldalsoenablethingslikedlg.
Menu.
Blah.
Blah.
IsChecked()IsEnabled(),etc42Chapter9.
PYWINAUTOTODO'spywinautoDocumentation,Release0.
6.
89.
1CLOSED(insomewayortheother)Allowdelayafterclicktoberemoved.
Themainreasonthatthisisneededatthemomentisbecauseifyoucloseadialogandthentryanactionontheparentimmediatelyitmaynotyetbeactive-sothedelayisneededtoallowittobecomeactive.
Toxthiswemayneedtoaddmoremagicaroundcallingactionsondialogse.
g.
onanattributeaccessforanActionDialogdothefollowing:–CheckifitisanAction–Ifitisnotenabledthenwaitalittlebit–Ifitisthenwaitalittlebitandtryagain–repeatthatuntilsuccessortimeoutThemainthingthatneedstoberesolvedisthatyoudon'twanttwoofthesewaitshappeningatonce(soawaitinafunctionat1level,andanotherwaitinafunctioncalledbytheotherone-becausethiswouldmeantherewouldbeaVERYlongdelaywhilethetimeoutofthenestedfunctionwasreachedthenumberoftimesthecallingfunctriedtosucceed!
)Addreferencingbycloseststatic(orsurroundinggroupbox)Needtomodularizethemethodsofthecommon_controlsbecauseatthemomenttheyaremuchtoomonolithic.
FinishexampleofsavingapagefromIEDocumentthatIhavenotbeenabletogureouthowtoreliablycheckifamenuitemisenabledornotbeforeselectingit.
(ProbablyFIXEDNOW!
)ForExampleinMediaPlayerifyoutryandclicktheView->ChooseColumnsmenuitemwhenitisnotenableditcrashesMediaPlayer.
TheoreticallyMF_DISABLEDandMF_GRAYEDshouldbeused-butIfoundthatthesearenotupdated(atleastforMediaPlayer)untiltheyaredroppeddown.
Implementanopionaltiming/congmodulesothatalltimingcanbecustomized9.
1.
CLOSED(insomewayortheother)43pywinautoDocumentation,Release0.
6.
844Chapter9.
PYWINAUTOTODO'sCHAPTER10ChangeLog10.
10.
6.
8BugFixes27-October-2019Enhancements:Addallow_magic_lookupagforApplicationandDesktopobject.
Thankspakal(https://github.
com/pakal)!
Don'tduplicatealreadypressedkeyininternallistinwin32_hooks.
py.
ThanksTomRobo237(https://github.
com/TomRobo237)!
Allowndinganeditboxbytitle(itseditabletext).
Addoptiontosendkeyboardinputforanapplicationwhichdoesn'thandleVK_PACKETproperly.
Usevk_packet=Falseinmethodtype_keys,defaultvalueisvk_packet=True.
Thanksphilmbailey(https://github.
com/philmbailey)!
BugFixes:Fixctypes.
windllusageconictswithotherlibraries.
Minorxesintop-level__init__.
py.
Thankspakal(https://github.
com/pakal)!
Fixloggingissuesinremote_memory_block.
py.
ThanksTomRobo237(https://github.
com/TomRobo237)!
Minordocsimprovements.
Thanksolesteban(https://github.
com/olesteban),caoyaxing221(https://github.
com/caoyaxing221)andnuno-andre(https://github.
com/nuno-andre)!
10.
20.
6.
7BugFixes07-July-2019Enhancements:Reusectypes.
wintypesmoretoavoidredundantdenitionsforWin32API.
AddmethodEditWrapper.
is_editable()for"uia"backend.
BugFixes:Fixcornercasewithint/longconversioncrashwhilegettingtext.
FixUIAcrash:handleInvalidControlTypeproperly.
45pywinautoDocumentation,Release0.
6.
8Fixmenu_select()foronelevelmainmenuinWinFormsapps.
MakeApplicationobjectnon-iterable(iteratingwashang).
FixtypeconversioncrashinGetWindowRect(method.
rectangle()).
Fixcomboboxuttering/blinkingindump_tree()/print_control_identifiers().
10.
30.
6.
6BetterWinForms/Qt5Support,BugFixes03-March-2019Enhancements:ImprovesupportforWinFormsandQt5:ComboBox,ListBox,DataGrid/Table.
AddanabilitytouseMFCtoolbarbuttonsbytext.
ThanksNebyt(https://github.
com/Nebyt)!
Makemethodkill()hard(andfast)bydefault(canbeusedwithparamsoft=Trueoptionally).
Makevisible_only=Falseadefaultoptionformethodconnect()(usefulforminimizedapps).
Addanabilitytoholdorreleaseakeywithparamsdownandupfor.
type_keys()method.
Seetheimproveddocsforkeyboardmoduleformoredetails.
Thanksbadari412(https://github.
com/badari412)!
Addmethodwindows()toclassDesktop.
AddRemoteExecutionGuidewithallknownRDP/VNC/psexec/etctricks.
BugFixes:FixUnicodeDecodeError/UnicodeEncodeErrorinseveralcaseswhileprintingwrapperobjectrepresentation.
Addstatictexttoalistofbestmatchnamesforbackend="uia".
FixCOMErrorforruntime_idproperty.
Fixmethodclick()forsomeradiobuttons.
Improveerrormessagewhenscreenislocked.
Useutf-8encodingwhilewritingdump_tree()outputtole.
Removefewincorrectwarningsforbackend="win32".
FixcrashinGetWindowRectcall.
Fixblackscreenshotissuewithsecondmonitor.
ThanksNebyt(https://github.
com/Nebyt)!
10.
40.
6.
5HandlingPrivileges,AutomationIDforWin32etc.
30-July-2018Enhancements:CheckadminprivilegesforbothtargetappandPythonprocess.
Thisallowsdetectingcaseswhenwindowmessageswon'twork.
Addautomation_idandcontrol_typepropertiesfor"win32"backend(themostusefulforWin-Forms).
Correctchild_window()keywordsareauto_idandcontrol_type.
Switchpypiwin32dependencytopywin32whichbecameofcialagain.
46Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8Newgeneratorsiter_children()anditer_descendants().
Addmethodis_checked()to"win32"checkbox.
BugFixes:MethodApplication().
connect(.
.
.
)worksbetterwithtimeoutargument.
Fix.
set_focus()for"uia"backendincludingminimizedwindowcase(issue#443).
maximize()/minimize()methodscanbechainednow.
Fixpassingkeywordargumentstoafunctionfordecorators@always_wait_until_passesand@always_wait_until.
UsecorrecttypesconversionforWaitGuiThreadIdle(issue#497).
FixreportingcodecoverageonLinux.
Use.
format()forloggingBaseWrapperactions(issue#471).
Printwarningincasebinarytypeisnotdetermined(issue#387).
10.
50.
6.
4NULLpointeraccessxandenhancements21-January-2018BugFixes:FinalxforValueError:NULLCOMpointeraccess.
Enhancements:Multi-threadingmode(MTA)forcomtypesisenabledbydefault,ifit'snotinitializedbyanotherlibrarybeforeimportingpywinauto.
Methodget_value()hasbeenaddedtoEditWrapperinUIAbackend.
Methodscroll()hasbeenaddedforallUIAcontrolswhichhaveScrollPatternimplemented.
Addedmethodsis_minimized/is_maximized/is_normal/get_show_stateforUIAWrap-per.
Addedhandlingin-placecontrolsinsideListViewcontroland(row,column)indexinginagrid-liketablemode.
Examples:auto_detected_ctrl=list_view.
get_item(0).
inplace_control()combo=list_view.
get_item(1,1).
inplace_control("ComboBox")combo.
select("Itemname")edit=list_view.
get_item(3,4).
inplace_control("Edit")edit.
type_keys("sometext{ENTER}",set_foreground=False)dt_picker=list_view.
get_item(2,0).
inplace_control("DateTimePicker")10.
60.
6.
3Alotofimprovementsandsomeoptimizations03-July-2017Improvedstringrepresentationforallwrapperobjects.
Thanksairelil(https://github.
com/airelil)!
10.
5.
0.
6.
4NULLpointeraccessxandenhancements47pywinautoDocumentation,Release0.
6.
8Fixedseveralsporadiccrashesforbackend="uia".
Fixedseveralbugsinwait/wait_notmethods:–Methodwait('exists')doesn'tworkforbackend="uia".
Thanksmaollm(https://github.
com/maollm)!
–Methodswait/wait_nottake~defaulttime(5sec.
)insteadofcustomizedtimeoutlike1sec.
depthparamcanusedinaWindowSpecificationnow.
depth=1meansthiscontrol,depth=2meansimmediatechildrenonlyandsoon(alignedwithprint_control_identifiersmethod).
Thanksdmitrykazanbaev(https://github.
com/dmitrykazanbaev)!
Signicantlyimprovedsendingkeystoaninactivewindowsilently.
Specialthanksforantonlarin(https://github.
com/antonlarin)!
Now2methodsareavailable:–send_charsissupposedtosendcharacterinput(thisincludes{Enter},{Tab},{Backspace})withoutAlt/Shift/Ctrlmodiers.
–send_keystrokesisforkeyinput(includingkeycombinationswithAlt/Shift/Ctrlmodiers).
MethodApplication().
connect(path='your.
exe')usesdefaulttimeoutTimings.
app_connect_timeout.
Itcanaccepttimeoutandretry_intervalkeywordarguments.
Thanksdaniil-kukushkin(https://github.
com/daniil-kukushkin)!
Methodprint_control_identifiersismoreconsistentandminimum2xfasternow!
Thankscetygamer(https://github.
com/cetygamer)!
FixedsubclassingApplicationwithyourownmethods.
Thanksefremovd(https://github.
com/efremovd)!
Paramwork_dircanbeusedinApplication().
start(.
.
.
).
Thanksefremovd(https://github.
com/efremovd)!
ClassApplicationhasbeenenrichedwithmethodsis_process_running()andwait_for_process_exit().
Thanksefremovd(https://github.
com/efremovd)!
Moduletimingsusestime.
clock()forPython2.
xandtime.
perf_counter()forPython3.
xsothataccidentsystemtimechangecan'taffectonyourscriptbehavior.
Thanksairelil(https://github.
com/airelil)!
AddedWireSharkexample.
ThanksViktorRoy94(https://github.
com/ViktorRoy94)!
Nowprint_control_identifiers()candumpUIelementstreetoale.
Thankssovrasov(https://github.
com/sovrasov)!
Improvedloggingactionsforbackend="uia",extendedexampleforMSPaint.
ThanksArtemSkre-bkov(https://github.
com/ArtemSkrebkov)!
ExtendedCalendarWrapperforbackend="win32"withthesemethods:get_month_delta,set_month_deltaandget_month_range.
ThanksNikita-K(https://github.
com/Nikita-K)!
Addedmethodlegacy_properties()toUIAWrapper.
ThanksAsyaPronina(https://github.
com/AsyaPronina)!
ImprovedVB6ListViewdetectionforbackend="win32".
ThanksKirillMoizik(https://github.
com/KirillMoizik)!
Fixed64-bitspecicbuginTreeViewWrapperforbackend="win32"(argument4::longinttoolongtoconvert).
48Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
810.
70.
6.
2Morebugxes28-February-2017Severalbugswerexed:–Maximizedwindowisalwaysresized(restored)whencallingset_focus().
–AttributeError:typeobject'_CustomLogger'hasnoattribute'disable'.
–print_control_identifiers()getsbytesstringonPython3.
x.
–Importingpywinautocausesdebugmessagestoappeartwice.
ImprovedclickmethodsbehaviourforWin32ListViewandTreeView:ensure_visible()iscalledinsidebeforetheclick.
Madetaskbar.
SystemTrayIconslocalizationfriendly.
10.
80.
6.
1BugxesandoptimizationsforUIAutomationandbeyond08-February-2017win32_hooksmoduleiswelltestedandmorereliablenow.
Seedetailedexample(https://github.
com/pywinauto/pywinauto/blob/master/examples/hook_and_listen.
py).
Fixedseveralbugsandcrasheshereandthere.
–Crashwhenctrl.
window_text()becomesNoneattherightmoment.
Thanksmborus(https://github.
com/mborus)!
–HwndWrapper.
set_focus()failswhenusedviainterpreter.
ThanksMatthewKennerly(https://github.
com/mtkennerly)!
–FixLoadLibrarycallerroronjustreleasedPython2.
7.
13.
ThanksKirillMoizik(https://github.
com/KirillMoizik)!
–AttributeError:WindowSpecicationclasshasno'CPUUsage'method.
–comtypesprintsalotofwarningsatimportpywinauto.
–Methodsis_dialog()andrestore()aremissedforUIAbackend.
–Methodprint_control_identifiers()crashesonsomeapplicationswithUnicodesym-bols.
–Installationbypythonsetup.
pyinstallmayfailifpyWin32dependencywasinstalledman-ually.
–Buginresolvingattributes:'UIAWrapper'objecthasnoattribute'Menu'fordlg=app.
Custom.
Menu–Methodsend_chars()cannowsend{ENTER}tosomeapplications.
ThanksMaxBolingbroke(https://github.
com/batterseapower)!
SearchingUIelementsisfasternowespeciallyifyouusecontrol_typeorauto_idinaWin-dowSpecication.
MethodApplication.
kill()isalsooptimizedinmanycases.
AddedanexampleforWin10Calculator(https://github.
com/pywinauto/pywinauto/blob/master/examples/win10_calculator.
p10.
7.
0.
6.
2Morebugxes49pywinautoDocumentation,Release0.
6.
810.
90.
6.
0IntroduceMSUIAutomationsupportandmanymoreim-provements30-October-2016ThisbigreleaseintroducesMSUIAutomation(UIA)support:–Juststartfromapp=Application(backend='uia').
start('your_app.
exe').
–Supportedcontrols:Menu,Button/CheckBox/RadioButton,ComboBox,Edit,Tabcontrol,List(ListView),DataGrid,Tree,Toolbar,Tooltip,Slider.
DocumentationisbuiltcontinuouslynowonReadTheDocs.
SeealsoimprovedGettingStartedGuide.
Newmulti-backendarchitecturemakesimplementationofnewplatformssupporteasierinthefu-ture.
Theminimalsetfornewbackendincludesitsnameandtwoclassesinheritedfromelement_info.
ElementInfoandfrompywinauto.
base_wrapper.
BaseWrapper.
Newbackendmustberegisteredbyfunctionpywinauto.
backend.
register().
CodestyleismuchclosertoPEP8:i.
e.
click_inputshouldbeusedinsteadofClickInput.
Initialimplementationofthewin32_hooksmodule.
Keyboardandmouseeventhandlerscanberegis-teredinthesystem.
ItwasinspiredbypyHook,pyhk,pyhookedandsimilarmodules,butre-writtenfromscratch.
ThanksforMaxSamokhvalov!
Theforkofthewin32_hooksmoduleisusedinpyhooked0.
8byEthanSmith.
Alotofsmallimprovementsarenotcountedhere.
10.
100.
5.
4BugxesandpartialMFCMenuBarsupport30-October-2015Fixbugsandinconsistencies:–Addwhere="check"possiblevaluetotheListViewWrapper.
Click/ClickInput'methods.
–AddCheckByClickInputandUncheckByClickInputmethodsforaplaincheckbox.
–Fixcrashwhilewaitingforthewindowstart.
AddpartialMFCMenuBarsupport.
Themenubarcanbeinterpretedasatoolbar.
ItemsareclickablebyindexthroughexperimentalMenuBarClickInputmethodoftheToolbarWrapper.
Python3.
5issupported.
10.
110.
5.
3BetterUnicodesupportforSetEditText/TypeKeysandmenuitems25-September-2015Betterbackwardcompatibilitywithpywinauto0.
4.
2:–supportUnicodesymbolsintheTypeKeysmethodagain;–allowSetEditText/TypeKeysmethodstotakenon-stringarguments;–xtakingUnicodeparametersinSetEditText/TypeKeys.
50Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8FixbuginWait("active"),raiseaSyntaxErrorwhenwaitingforanincorrectstate.
Re-considersometimings,updatedocsforthedefaultvaluesetc.
Fixseveralissueswithanowner-drawnmenu.
MenuItemmethodClickisrenamedtoClickInputwhileClick=Selectnow.
NewSetTransparencymethodcanmakeawindowtransparentinaspecieddegree.
10.
120.
5.
2ImproveListView,newmethodsforCPUusage,DPIawareness07-September-2015NewApplicationmethods:CPUUsagereturnsCPUusageasapercent(oatnumber),WaitCPUUsageLowerwaitsuntiltheconnectedprocess'CPUusageislowerthanaspeciedvalue(2.
5%bydefault).
Anewclass_listview_item.
Itisverysimilarto_treeview_element.
AddDPIawarenessAPIsupport(Win8+).
Itallowscorrectworkwhenallfontsarescaledat125%,150%etc(globallyorpermonitor).
"Toolsoverview"sectionindocs.
Fixnumberofbugs:–TreeViewWrapper.
Selectdoesn'tworkwhenthecontrolisnotinfocus.
–TabControlWrapper.
Selectdoesn'tworkincaseofTCS_BUTTONSstyleset.
–ListViewWrappermethodsCheck/UnCheckarexed.
–Toolbarbutton:incorrectaccessbyatooltiptext.
–Warning"Cannotretrievetextlengthforhandle"usesprint()insteadofactionlogger.
–ClientToScreenmethoddoesn'treturnavalue(modifyingmutableargumentisnotgoodpractice).
10.
130.
5.
1Severalxes,moretests13-July-2015ResolvepipissuesWarnuseraboutmismatchedPython/applicationbitness(64-bitPythonshouldbeusedfor64-bitapplicationand32-bitPythonisfor32-bitapp)Add"TCheckBox"classnametoButtonWrapperdetectionlistFixDebugMessagemethodDisablelogging(actionlogger.
py)bydefault,provideshortcuts:actionlogger.
enable()andactionlogger.
disable().
Forthosewhoarefamiliarwithstandardloggingmodulethere'smethodactionlogger.
set_level(level)10.
12.
0.
5.
2ImproveListView,newmethodsforCPUusage,DPIawareness51pywinautoDocumentation,Release0.
6.
810.
140.
5.
064-bitPy2/Py3compatibility30-June-201564-bitPythonand64-bitappssupport(but32-bitPythonisrecommendedfor32-bitapps)Python2.
x/3.
xcompatibilityAddedpyWin32dependency(silentinstallbypipfor2.
7and3.
1+)ImprovementsforToolbar,TreeView,UpDownandDateTimePickerwrappersImprovedbest_matchalgorithmallowsnameslikeToolbarFileClickscanbeperformedwithpressedCtrlorShiftDrag-n-dropandscrollingmethods(DragMouse,DragMouseInput,MouseWheelInput)Improvedmenusupport:handlingOWNERDRAWmenuitems;accessbycommand_id(like$23453)Resolvedissueswithpy2exeandcx_freezeRemoteMemoryBlockcannowdetectmemorycorruptionbycheckingguardsignatureUpgradedtaskbarmodulesysinfomoduleforchecking32-bitor64-bitOSandPythonset_foregroundaginTypeKeysmethodfortypingintoin-placecontrolsagscreate_new_consoleandwait_for_idleinApplication.
startmethod10.
150.
4.
0Variouscleanupandbugxes03-April-2010GracefullyHandledir()callsonApplicationorWindowSpecicationobjects(whichusedhangforawhileastheseclasseswouldsearchforwindowsmatching__members__,__methods__and__bases__).
Thecodenowchecksforanyattributethatstartswith'__'andendswith'__'andraisesAttributeErrorimmediately.
ThankstoSebastianHaaseforraisingthis.
RemovedthereferencetoanApplicationobjectinWindowSpecication.
Itwasnotusedintheclassandmadetheclasshardertouse.
WindowSpecicationisnowmoreusefulasautilityclass.
Addimportsofapplication.
WindowSpecicationandapplication.
Applicationtopywinauto.
__init__.
pysothattheseclassescanbeusedmoreeasily(withouthavingtodirectlyimportpywinauto.
application).
ThanksagaintoSebastianHaase.
Addedafunctiontoemptytheclipboard(thankstoToceronSourceforge)Use'SendMessageTimeout'togetthetextofawindow.
(SendMessagewillhangiftheapplicationisnotprocessingmessages)FixedreferencestoPIL.
ImageGrab.
PILadd'sit'smoduledirectlytothemodulepath,soitshouldjustbereferencedbyImageGrabandnotPIL.
ImageGrab.
UseAttachThreadInput+PostMessageratherthanSendMessageTimeouttosendmouseclicks.
Fixhowtimeoutretrytimesarecalculatedintimings.
WaitUntil()andtimings.
WaitFixedsomeissueswithapplication.
Kill_()method,highlightedduetothechangesintheHwndWrapper.
Close()method.
52Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8FixwritingimagestoXML.
ItwasbrokenwithupdatestoPILthatIhadnotfollowed.
Changedthemethodofknowingifitisanimagebycheckingforvariousattributes.
RenamedWindowSpecication.
(Ww)indow()toChildWindow()andaddeddeprecationmessagesfortheotherfunctions.
Improvedthetests(xedtestfailureswhichwerenotpywinautoissues)10.
160.
3.
9Experimental!
NewSendkeys,andvariousxes27-November-2009MajorchangethisreleaseisthatSendkeysisnolongerarequirement!
AreplacementthatsupportsUnicodeisincludedwithpywinauto.
(hopefullysoontobereleasedasastandalonemodule).
Pleasenote-thisisstillquiteuntestedsothisreleaseshouldbetreatedwithsomecare.
.
MadesurethatdefaultforWindowSpecication.
Window_()wastolookfornontoplevelwindows.
Thedefaultsinnd_windows()hadbeenchangedpreviouslyanditnowneededtobeexplicitlyoverridden.
Fixedamissingreferenceto'win32denes'whenreferencingWAIT_TIMEOUTanothertypooffalse(changedtoFalse)Removedtherestrictiontoonlygettheactivewindowsfortheprocess,nowitwillbepossibletogettheactivewindows,evenifaprocessisnotspecied.
Fromhttp://msdn.
microsoft.
com/en-us/library/ms633506%28VS.
85%29.
aspxitgetstheactivewindowfortheforegroundthread.
HopefullyimprovedDelphiTreeViewandListViewhandling(addedwindowclassnamesassupportedwindowclassestotheappropriateclasses).
AddedsupportforrunningUItestswithreferencecontrols.
(requriedforsomelocalizationtests)VariousPyLintandPEP8xesmade.
10.
170.
3.
8Collectingimprovementsfromlast2years10-March-2009Fixedtoolbarbuttonpressing-ThisrequiredforHwndWrapper.
NotifyParent()tobeupdated(toacceptanewIDparameter)Fixedabugwherealistviewwithoutacolumncontrolwouldmakepywinautofailtocapturethedialog.
ConverteddocumenationfromPudgegeneratedtoSphinxGeneratedAddedsomebaicsupportforPagerandProgresscontrols(notestsyet)AddedsomemoreVB'edit'windowclassesAddedsomemoreVB'listbox'windowclassesAddedsomemoreVB'button'windowclassesEnsuredthatreturnvaluefromComboBoxWrapper.
SelectedIndicesisalwaysatuple(therewasabugwhereitwouldsometimesbeactypesarray)Changeddefaultforndingwindowstonddisabledwindowsaswellasenabledones(previouswastondenabledwindowsonly)(notethismayimpactscriptsthatreliedontheprevioussettingi.
e.
incaseswheretwodialogshavethesametitle!
)10.
16.
0.
3.
9Experimental!
NewSendkeys,andvariousxes53pywinautoDocumentation,Release0.
6.
8MuchbetterhandlingofInvalidWindowHandleduringautomationruns.
Thiscouldberaisedwhenaclosingwindowisstillavailablewhentheautomationwascalled,butisgonehalfwaythroughwhateverfunctionwascalled.
MadeclickingmorerobustbyaddingatinywaitbetweeneachSendMessageTimeoutin_perform_click().
Addedattributescan_be_labelandhas_titletoHwndWrapperandsubclassestospecifywhetheracontrolcanactasalabelforothercontrols,andwhetherthetitleshouldbeusedforidentifyingthecontrol.
IfyouhavecreatedyourownHwndWrappersubclassesyoumayneedtooverridethedefaults.
Addedacontrol_idparametertond_windowswhichallowsndingwindowsbasedoffoftheircontrolid'sAddedaFriendlyClassNamemethodtoMenuItemSplitupthefunctionsforbuttontruncationdataCommentedoutcodetogetanewfontifthefontcouldnotberecoveredMovedcodetogetthecontrolfontfromTruncationtesttohandlepropsAddedafunctiontogetthestringrepresentationofthebug.
(needtorefactorPrintBugsatsomepoint).
Fixedavariablename(fromfname->font_attribasfnamewasnotadenedvariable!
)ForcedsomereturnvaluesfromMissingExtraStringtesttobeUnicodeFixedtheMiscValuestest(convertedtoUnicodeandremovedsomeextraneouscharacters)UpdatedthepathforallunittestsMadetwounittestssligthlymorerobustandlessdependentoncomputer/appsettingsUpdatedtimingsettingsforunittestsUpdatedtheexamplestoworkindevenvironment.
10.
180.
3.
7MergeofWaitchangesandvariousbugxes/improvements10-April-2007AddedTimings.
WaitUntil()andTimings.
WaitUntilPasses()whichhandlethevariouswaituntilsomethinginthecode.
Alsorefactoredexistingwaitstousethesetwomethods.
FixedamajorHandleleakinRemoteMemorBlockclass(whichisusedextensivelyfor'Common'controls.
IwasusingOpenHandletoopentheprocesshandle,butwasnotcallingCloseHandle()foreachcorrespondingOpenHandle().
Addedanactive_()methodtoApplicationclasstoreturntheactivewindowoftheapplication.
Addedan'active'optiontoWindowSpecication.
Wait()andWaitNot().
Somecleanupoftheclipboardmodule.
GetFormatName()wasimprovedandGetData()madealittlemorerobust.
Addedanoptiontondwindows.
nd_windows()tondonlyactivewindows(e.
g.
active_only=True).
DefaultisFalse.
Fixedabuginthetimings.
Timingsclass-timingvaluesareNowaccessedthroughtheclass(Timings)andnotthroughtheintance(self).
54Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8UpdatedElementTreeimportinXMLHelperssothatitwouldworkonPython2.
5(whereelementtreeisastandardmodule)aswellasotherversionswhereElementTreeisaseparatemodule.
EnhancedItemselectionforListViews,TreeViews-itisnowpossibletopassstringsandtheywillbesearchedfor.
Moredocumentationisrequiredthough.
GreatlyenhancedToolbarbuttonclicking,selection,etc.
Thoughmoredocumentationisrequired.
AddedoptiontoClickInput()toallowmousewheelmovementstobemade.
menuwrapper.
Menu.
GetProperties()nowreturnsadictlikeallotherGetProperties()methods.
Thisdictfornowonlyhasonekey'MenuItems'whichcontainsthelistofmenuitems(whichhadbeenthepreviousreturnvalue).
10.
190.
3.
6bChangesnotdocumentedin0.
3.
6history31-July-2006Fixedabuginhowndbestmatch.
FindBestMatcheswasworking.
Itwouldmatchagainsttextwhenitshouldnot!
Updatedhowtimings.
Timings.
Slow()worked,ifanytimesettingwaslessthen.
2after'slowing'thensetitto.
210.
200.
3.
6ScrollingandTreviewItemClickingadded28-July-2006Addedparameterto_treeview_item.
Rectangle()tohaveanoptiontogettheTextrectangleoftheitem.
Anddefaultedtothis.
Added_treeview_item.
Click()methodtomakeiteasytoclickontreeviewitems.
FixedabuginTreeView.
GetItem()thatwasexpandingitemswhenitshouldn't.
AddedHwndWrapper.
Scroll()methodtoallowscrolling.
Thisisaveryminimalimplementation-andifthescrollbarsareimplementedasseparatecontrols(ratherthenapropertyofacontrol-thiswillprobablynotworkforyou!
).
ItworksforNotepadandPaint-thatisallIhavetriedsofar.
AddedacalltoHwndWrapper.
SetFocus()in_perform_click_input()sothatcallstoHwndWrapper.
ClickInput()willmakesuretoclickonthecorrectwindow.
10.
210.
3.
5MovedtoMetaclasscontrolwrapping24-May-2006Movedtoametaclassimplementationofcontrolnding.
Thisremovessomecyclicimportingthathadtobeworkedaroundandotherthenmetaclassmagicmakesthecodeabitsimpler.
Someofthesampleleswouldnotrun-soIupdatedthemsotheywould(ThankstoStefaanHimpeforpointingthisout)Disabledsavingapplicationdata(itwasstillbeingsavedinApplication.
RecordMatch()eveniftherestoftheapplicationdatacodeisdisabled.
Thiswascausingwhatappearedtobeamemoryleakwherepywinautowouldkeepgrabbingmoreandmorememory(especiallyforcontrolsthatcontainalotofinformation).
ThankstoFrankMartinezforleadingmetothis).
10.
19.
0.
3.
6bChangesnotdocumentedin0.
3.
6history55pywinautoDocumentation,Release0.
6.
8AddedListViewWrapper.
GetItemRect()toenableretrievingtherectangleforaparticulariteminthelistview.
Removedreferencesto_ctrl()methodwithinpywinautoasitwasraisingaDeprecationWarninginternallyeveniftheuserwasnotusingit.
10.
220.
3.
4Fixedissuewithlatestctypes,speedgains,otherchanges25-Apr-2006Thelatestversionofctypes(0.
9.
9.
6)removedthecodegeneratorIwasusingsomegeneratedcodeinwin32functions.
py(stdcall).
IwasnotusingthosefunctionssoIjustcommentedthemout.
StartedtheprocessofrenamingmethodsoftheApplicationandWindowSpecificationclasses.
IwillbeconvertingnamestoUppercaseNames_().
Thetrailing_istodisambiguatethemethodnamesfrompotentialWindowtitles.
Updatedhowprint_control_identiersworkssothatitnowalwaysprintsthedisambiguatedcontrolname.
(evenforsinglecontrols)Added__hash__toHwndWrappersothatcontrolscouldbedictionarykeys.
Cachingvariousinformationatvariouspoints.
ForexampleIcachehowwelltwopiecesoftextmatch.
Forshortscriptsthishaslittleimpact-butforlargerscriptitcouldwellhaveamajorimpact.
Alsocachinginformationforcontrolsthatcannotchangee.
g.
TopLeveParent,Parent,etc10.
230.
3.
3Addedsomemethods,andxedsomesmallbugs19-Apr-2006Addedawaitforthecontroltobeactiveandcongurablesleepsafter'modifying'actions(e.
g.
Select,Deselect,etc)FixedTimings.
Slow()andTimings.
Fast()-theycouldincertaincircumstancesdotheopposite!
Ifyouhadalreadysetatimingslowerorfasterthentheywouldsetitthentheywouldblindlyignorethatandsettheirowntimes.
Iaddedfunctionalitythattheywilltakeeithertheslowestorfastestofthenew/currentsettingratherthenblindlysettingtothenewvalue.
FixedsomehiddenbugswithHwndWrapper.
CloseClick()Fixedabuginsetup.
pythatwouldraiseanerrorwhennoargumentwasspeciedAddedanargumenttoHwndWrapper.
SendMessageTimeoutsothatthewaitoptionscouldbepassedin.
AddedHwndWrapper.
Close(),Maximize(),Minimize(),Restore()andGetShowState().
Commentedoutalldeprecatedmethods(willberemovedcompletelyinsomefuturerelease).
AddedApplication.
kill_()method-whichclosesallwindowsandkillstheapplication.
Iftheapplicationisaskingifyouwanttosaveyourchanges-youwillnotbeabletoclickyesornoandtheapplicationwillbekilledanyway!
.
10.
240.
3.
2Fixedsetup.
pyandsometypos31-Mar-200656Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8FixedthespellingofStefaanHimpe'snameFixedsetup.
pywhichwasworkingforcreatingadistributionbutnotforinstallingit(againthankstoStefaanforpointingitout!
)10.
250.
3.
1Performancetune-ups30-Mar-2006Changecalculationofdistanceinndbestmatch.
GetNonTextControlName()sothatitdoesnotneedtosquareorgetthesquareroottondtherealdistance-asweonlyneedtocomparevalues-nothavetheactualdistance.
(ThankstoStefaanHimpe)Compiledregularexpressionpatternsbeforedoingthematchtoavoidcompilingtheregularexpressionforwindowthatisbeingtested(ThankstoStefaanHimpe)Madeiteasiertoaddyourowncontroltestsbyaddingaleextra_tests.
pywhichneedstoexportaModifyReg-isteredTests()method.
Alsocleanedupthecodealittle.
Updatednotepad_fast.
pytomakeiteasiertoprole(addeamethod)ChangedWrapHandletouseacacheforclassesithasmatched-thisistoavoidhavingtomatchagainstallclassesconstantly.
ChangeddefaulttimeoutinSendMessageTimeoutto.
001secondsfrom.
4secondsthisresultsinasignicantspeedup.
Willneedtomakethisvaluemodiableviathetimingmodule/routine.
WaitNotwasraisinganerrorifthecontrolwasnotfound-itshouldhavereturned(i.
e.
success-controlisnotinanyparticularstatebecauseitdoesnotexist!
).
AddedListViewWrapper.
Deselect()perChistopheKeller'ssuggestion.
WhileIwasatitIaddedacheckontheitemvaluepassedinandaddedacalltoWaitGuiIdle(self)sothatthecontrolhasachancetoprocessthemessage.
Changeddoctemplatesandmoveddependenciesintopywinautosubversiontoensurethatallleswereavailabeatwww.
openqa.
organdthattheyarenotbrokenwhenviewedthere.
Movedalltiminginformationintothetimings.
Timingsclass.
Therearesomesimplemethodsforchangingthetimings.
10.
260.
3.
0AddedApplicationdata-nowusefulforlocalizationtest-ing20-Mar-2006AddedautomaticApplicationdatacollectionwhichcanbeusedwhenrunningthesametestonadifferentspokenlanguageversion.
Supportisstillpreliminaryandisexpectedtochange.
PleasetreatasearlyAlpha.
IfyouhaveadifferentlanguageversionofWindowsthenyoucantrythisoutbyrunningthenotepad_fast.
pyexamplewiththelangaugeargumente.
g.
examples\notepad_fast.
pylanguageThiswillloadtheapplicationdatafromthesuppliedlenotepad_fast.
pklanduseitforndingtherightmenuitemsandcontrolstoselect.
Testimplementationtomakeiteasiertostartusinganapplication.
Previouslyyouneededtowritecodelike10.
25.
0.
3.
1Performancetune-ups57pywinautoDocumentation,Release0.
6.
8app=Application().
connect_(title='Find')app.
Find.
Close.
Click()app.
NotePad.
MenuSelect("File->Exit")1stchangewastoimplementstaticmethodsstart()andconnect().
ThesemethodsreturnanewAppli-cationinstancesotheabovecodebecomes:app=Application.
connect(title='Find')app.
Find.
Close.
Click()app.
NotePad.
MenuSelect("File->Exit")Ialsowantedtomakeiteasiertostartworkingwithasimpleapplication-thatmayormaynothaveonlyonedialog.
TomakethissituationeasierImadewindow_()notthrowiftheapplicationhasnotbeenstart()edorconnect()edrst.
Thisleadstosimplercodelike:app=Application()app.
Find.
Close.
Click()app.
NotePad.
MenuSelect("File->Exit")WhathappenshereisthatwhenyouexecuteanyofApplication.
window_(),Application.
__getattr__()orAp-plication.
__getitem__()whentheapplicationhasn'tbeenconnectedorstarted.
Itlooksforthewindowthatbestmatchesyourspecicationandconnectstheapplicationtothatprocess.
Thisisextrafunctionality-existingconnect_()andstart_()methodsstillexistFixedHwndWrapper.
SetFocus()sothatitwouldworkevenifthewindowwasnotintheforeground.
(itnowmakesthewindowforegroundaswellasgivingitfocus).
ThisovercomesarestrictioninWindowswhereyoucanonlychangetheforegroundwindowifyouowntheforegroundwindow.
Changedsome2.
4'ismsthatananonymouscommenterleftonmyblog:-)withthesechangespywinautoshouldrunonPython2.
3(thoughIhaven'tdoneextensivetesting).
Commentedoutcontrols.
common_controls.
TabControlWrapper.
GetTabState()andTabStates()asthesedidnotseemtobereturningvalidvaluesanyway.
FixeddocumentationissueswerepartsofthedocumentationwerenotgettinggeneratedtotheHTMLles.
FixedissuewhereMenuSelectwouldsometimesnotworkasexpected.
SomeMenuactionsrequirethatthewindowthatownsthemenubeactive.
AddedacalltoSetFocus()beforeselectingamenuitemtoensurethatthewindowwasactive.
FixedBug1452832whereclipboardwasnotclosedinclipboard.
GetData()Addedmoreunittestsnowupto248from20710.
270.
2.
5Morerefactoring,moretests07-Mar-2006AddedwrapperclassesforMenusandMenuItemsthisenabledcleanerinteractionwithMenu's.
Italsogivesmorefunctionality-youcannowprogrammaticallyClick()onmenus,andqueryifamenuitemischeckedornot.
Addedapplication.
WindowSpecication.
Wait()andWaitNot()methods.
Thesemethodsallowyoutowaitforacontroltoexist,bevisible,beenabled,beready(bothenabledandvisible!
)ortowaitforthecontroltonotbeinanyofthesestates.
WaitReady(),WaitNotEnabled(),WaitNotVisible()nowusethesemethods.
IwasabletoalsoaddthemissingmethodsWaitNotReady(),WaitEnabled(),WaitVisible(),WaitExists(),WaitnotExists().
PleaseuseWait()andWaitNot()asIhaveDeprecatedtheseWait*methods.
58Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
8Slightlymodiedtimeoutwaitsforcontrolresolutionsothatatimedfunctionmoreaccuratelyfollowsthetimeoutvaluespecied.
Addedapplication.
Application.
start()andconnect()staticmethods.
ThesemethodsarefactorymethodsinthattheywillreturnaninitializedApplicationinstance.
Theyworkexactlythesameasstart_()andconnect()astheyareimplementedintermsofthose.
frompywinauto.
applicationimportApplicationnotepad=Application.
start("notepad")same_notepad=Application.
connect(path="notepad")Updatedtheexamplestofollowchangestothecode-andtomakethemalittlemorerobust.
AddedanewControlsOverviewdocumentpagewhichlistsalltheactionsonallcontrols.
Addedmoreunittestsnowupto207from134(added68tests)10.
280.
2.
1SmallReleasenumber-bigchanges17-Feb-2006Quickreleasetogetmanychangesoutthere-butthisreleasehasbeenlesstestedthenIwouldlikefora.
3release.
AllowaccesstonontextcontrolsusingtheclosestTextcontrol.
Thisclosesttextcontrolwillnormallybethestatic/labelassociatedwiththecontrol.
ForexampleinNotepad,Format->Fontdialog,the1stcomboboxcanbereferedtoas"FontComboBox"ratherthan"ComboBox1"Addedanewcontrolwrapper-PopupMenuWrapperforcontextmenu'sYoucannowworkeasilywithcontextmenu'se.
g.
app.
Notepad.
Edit.
RightClick()#needtouseMenuClickratherthenMenuSelectapp.
PopupMenu.
MenuClick("SelectAll")app.
Notepad.
Edit.
RightClick()app.
PopupMenu.
MenuClick("Copy")IcouldthinkofmergingtheRightClick()andMenuSelect()intoonemethodContextMenuSelect()ifthatmakessensetomostpeople.
AddedSupportforUp-DowncontrolsNotalltoplevelwindowsnowhaveaFriendlyClassNameof"Dialog".
Ichangedthisbecauseitmadeithardtogetwindowsofaparticularclass.
ForexamplethemainNotepadwindowhasaclassnameof"Notepad".
ThiswasprimarilyimplementedduetoworkIdidgettingtheSystemTray.
RenamedStatusBarWrapper.
PartWidths()toPartRightEdges()asthisismorecorrectforwhatitreturns.
ChangedHwndWrapper.
Text()andSetText()toWindowText()andSetWindowText()respectivelytotryandmakeitclearerthatitisthetextreturnedbyGetWindowTextandnotthetextthatisvisibleonthecontrol.
ThischangealsosuggestedthatEditWrapper.
SetText()bechangedtoSetEditText()(thoughthisisnotahardrequirementEditWrapper.
SetText()stillexists-butmaybedeprecated.
AddedClickInput,DoubleClickInput,RightClickInput,PressMouseInputReleaseMouseInputtoHwndWrapper-theseuseSendInputratherthenWM_LBUTTONDOWN,WM_RBUTTONUP,etcusedbyClick,DoubleClicketc.
IalsoaddedaMenuClickmethodthatallowsyoutoclickonmenuitems.
Thismeansyoucannow'physically'dropmenusdown.
10.
28.
0.
2.
1SmallReleasenumber-bigchanges59pywinautoDocumentation,Release0.
6.
8Somefurtherworkingwithtooltipsthatneedtobecleanedup.
FixedabugwherecoordinatespassedtoanyoftheClickoperationshadtheXandYcoordinatesswapped.
AddednewMenuItemandMenuclassesthataretothemostparthiddenbutyoucangetamenuitembydoingapp.
Notepad.
MenuItem("View")app.
Notepad.
MenuItem("View->StatusBar")MenuItemshavevariousactionssoforexampleyoucanuseMenuItem.
IsChecked()tocheckifthemenuitemischecked.
AmongothermethodsthereareClick()andEnabled().
Modiedthe'bestmatch'algorithmforndingcontrols.
Itnowsearchesacoupleoftimes,andtriestondthebesttforthetextpassedtoit.
Theideahereistomakeitmore"SelectwhatIwant-notthatotherthingthatlooksabitlikewhatIwant!
".
Itispossiblethischangecouldmeanyouneedtousenewidentiersinscripts-butingeneralverylittlemodicationshouldbenecessary.
Therewasalsoachangetothealgorithmthatlookedfortheclosesttextcontrol.
Itmissedsomeobviouscontrolsinthepreviousimplementation.
Italsohadabugforcontrolsabovethecontrolratherthantotheleft.
AddedanewexamplescriptsSaveFromInternetExplorer.
pyandSaveFromFirefox.
pywhichshowautomatingdownloadingofapagefromeitherofthesebrowsers.
Addedyetmoreunittests,therearenowatotalof134tests.
10.
290.
2.
0Signicantrefactoring06-Feb-2006Changedhowwindowsaresearchedfor(fromapplication)ThischageshouldnotbeasignicantchangeforusersStartedaddingunittests(andthehavealreadyuncoveredbugsthatbeenxed).
TheyalsopointtoareasofmissingfunctionalitythatwillbeadddedwithfutureupdatesChangedfrompropertyaccesstoControlattributestofunctionaccessIfyourcodewasaccessingpropertiesofcontrolsthenthismightbeasignicantchange!
Themainreasonsfordoingthiswereduetotheinheritabilityofproperties(orlackthere-of!
)andtheadditionalscafoldingthatwasrequiredtodenethemall.
UpdatedtheDialogWrapper.
MenuSelect()methodtonotifytheparentthatitneedstoinitializethemenu'sbeforeitretrievestheitemsAddedfunctionalitytoassociate'non-text'controlswiththe'text'controlclosesttothem.
Thisallowscontrolstobereferencedby:app.
dlg.
e.
g.
toreferencethe"Footer"editcontrolinthePageSetupdialogyoucoulduse:app.
PageSetup.
FooterEditAddedaMoveWindowmethodtoHwndWrapperDidsomemorecleanup(xingpylintwarnings)butstillnotnishedAddedsomebettersupportfor.
NETcontrols(nottobeconsiderednal)60Chapter10.
ChangeLogpywinautoDocumentation,Release0.
6.
810.
300.
1.
3Manychanges,fewvisible15-Jan-2006Wrotedocstringsforallmodules,classesandfunctionsRanpycheckerandpylintandxedsomeerrors/warningchanged_connect,_start,_window,_control,_writerespectivelytoconnect_,start_,window_,connect_,write_Ifyouforgettochange_window,_connectand_startthenyouwillprobablygetthefollowingerror.
TypeError:'_DynamicAttributes'objectisnotcallablepywinautoisnowapackagename-youneedtoimportitoritsmodulesChangestothecodetodealwithpywinautopackagenameFixedsearchingforwindowsifaParentispassedinAddedIndextoretrievedMenuItemdictionaryAddedachecktoensurethatawindowsHandleisavalidwindowRefactoredsomeofthemethodsincommon_controlsRefactoredhowFriendlyClassNameisdiscovered(andstillnotreallyhappy!
10.
310.
1.
2AddReadmeandrollupvariouschanges15-Jan-2006UpdatedReadme(originalreadmewasincorrect)AddedclipboardmoduleFixedDrawOutlinepartoftests.
__init__.
print_bugsAddedaNotifyParenttoHwndWrapperMakesurethatHwndWrapper.
refisinitializedtoNoneRefactoredsomemethodsofComboBoxandListBoxUpdatedCombo/ListBoxselectionmethodsRemovedhardcodedpathsfromtest_application.
pyAddedsectiontosavethedocumentasUTF-8inMinimalNotepadTestFixedEscapeSpecialsandUnEscapeSpecialsinXMLHelpersMadesurethatoverlylargebitmapsdonotbreakXMLwriting10.
30.
0.
1.
3Manychanges,fewvisible61pywinautoDocumentation,Release0.
6.
810.
320.
1.
1Minorbugxrelease12-Jan-2006Fixedsomeminorbugsdiscoveredafterrelease10.
330.
1.
0InitialRelease6-Jan-200662Chapter10.
ChangeLogCHAPTER11Sourcecodereference11.
1BasicUserInputModules11.
1.
1pywinauto.
mouseCross-platformmoduletoemulatemouseeventslikearealuserpywinauto.
mouse.
click(button='left',coords=(0,0))Clickatthespeciedcoordinatespywinauto.
mouse.
double_click(button='left',coords=(0,0))Doubleclickatthespeciedcoordinatespywinauto.
mouse.
move(coords=(0,0))Movethemousepywinauto.
mouse.
press(button='left',coords=(0,0))Pressthemousebuttonpywinauto.
mouse.
release(button='left',coords=(0,0))Releasethemousebuttonpywinauto.
mouse.
right_click(coords=(0,0))Rightclickatthespeciedcoordspywinauto.
mouse.
scroll(coords=(0,0),wheel_dist=1)Domousewheelpywinauto.
mouse.
wheel_click(coords=(0,0))Middlemousebuttonclickatthespeciedcoords11.
1.
2pywinauto.
keyboardKeyboardinputemulationmoduleAutomatetypingkeysorindividualkeyactions(viz.
pressandhold,release)toanactivewindowbycallingsend_keysmethod.
YoucanuseanyUnicodecharacters(onWindows)andsomespecialkeyslistedbelow.
ThemoduleisalsoavailableonLinux.
Availablekeycodes:63pywinautoDocumentation,Release0.
6.
8{SCROLLLOCK},{VK_SPACE},{VK_LSHIFT},{VK_PAUSE},{VK_MODECHANGE},{BACK},{VK_HOME},{F23},{F22},{F21},{F20},{VK_HANGEUL},{VK_KANJI},{VK_RIGHT},{BS},{HOME},{VK_F4},{VK_ACCEPT},{VK_F18},{VK_SNAPSHOT},{VK_PA1},{VK_NONAME},{VK_LCONTROL},{ZOOM},{VK_ATTN},{VK_F10},{VK_F22},{VK_F23},{VK_F20},{VK_F21},{VK_SCROLL},{TAB},{VK_F11},{VK_END},{LEFT},{VK_UP},{NUMLOCK},{VK_APPS},{PGUP},{VK_F8},{VK_CONTROL},{VK_LEFT},{PRTSC},{VK_NUMPAD4},{CAPSLOCK},{VK_CONVERT},{VK_PROCESSKEY},{ENTER},{VK_SEPARATOR},{VK_RWIN},{VK_LMENU},{VK_NEXT},{F1},{F2},{F3},{F4},{F5},{F6},{F7},{F8},{F9},{VK_ADD},{VK_RCONTROL},{VK_RETURN},{BREAK},{VK_NUMPAD9},{VK_NUMPAD8},{RWIN},{VK_KANA},{PGDN},{VK_NUMPAD3},{DEL},{VK_NUMPAD1},{VK_NUMPAD0},{VK_NUMPAD7},{VK_NUMPAD6},{VK_NUMPAD5},{DELETE},{VK_PRIOR},{VK_SUBTRACT},{HELP},{VK_PRINT},{VK_BACK},{CAP},{VK_RBUTTON},{VK_RSHIFT},{VK_LWIN},{DOWN},{VK_HELP},{VK_NONCONVERT},{BACKSPACE},{VK_SELECT},{VK_TAB},{VK_HANJA},{VK_NUMPAD2},{INSERT},{VK_F9},{VK_DECIMAL},{VK_FINAL},{VK_EXSEL},{RMENU},{VK_F3},{VK_F2},{VK_F1},{VK_F7},{VK_F6},{VK_F5},{VK_CRSEL},{VK_SHIFT},{VK_EREOF},{VK_CANCEL},{VK_DELETE},{VK_HANGUL},{VK_MBUTTON},{VK_NUMLOCK},{VK_CLEAR},{END},{VK_MENU},{SPACE},{BKSP},{VK_INSERT},{F18},{F19},{ESC},{VK_MULTIPLY},{F12},{F13},{F10},{F11},{F16},{F17},{F14},{F15},{F24},{RIGHT},{VK_F24},{VK_CAPITAL},{VK_LBUTTON},{VK_OEM_CLEAR},{VK_ESCAPE},{UP},{VK_DIVIDE},{INS},{VK_JUNJA},{VK_F19},{VK_EXECUTE},{VK_PLAY},{VK_RMENU},{VK_F13},{VK_F12},{LWIN},{VK_DOWN},{VK_F17},{VK_F16},{VK_F15},{VK_F14}~isashorteraliasfor{ENTER}Modiers:'+':{VK_SHIFT}'^':{VK_CONTROL}'%':{VK_MENU}a.
k.
a.
AltkeyExamplehowtousemodiers:send_keys('^a^c')#selectall(Ctrl+A)andcopytoclipboard(Ctrl+C)send_keys('+{INS}')#insertfromclipboard(Shift+Ins)send_keys('%{F4}')#closeanactivewindowwithAlt+F4Repetitioncountcanbespeciedforspecialkeys.
{ENTER2}saystopressEntertwice.
Examplewhichshowshowtopressandholdorreleaseakeyonthekeyboard:send_keys("{VK_SHIFTdown}""pywinauto""{VK_SHIFTup}")#totypePYWINAUTOsend_keys("{hdown}""{edown}""{hup}""{eup}""llo")#totypehelloUsecurlybrackerstoescapemodiersandtypereservedsymbolsassinglekeys:send_keys('{^}a{^}c{%}')#typestring"^a^c%"(Ctrlwillnotbepressed)send_keys('{{}ENTER{}}')#typestring"{ENTER}"withoutpressingEnterkeyForWindowsonly,pywinautodefaultstosendingavirtualkeypacket(VK_PACKET)fortextualinput.
ForapplicationsthatdonothandleVK_PACKETappropriately,thevk_packetoptionmaybesetto64Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8False.
Inthiscasepywinautowillattempttosendthevirtualkeycodeoftherequestedkey.
Thisoptiononlyaffectsthebehaviorofkeysmatchinga-zA-Z0-9].
Notethatupperandlowercaseareincludedfora-z.
Bothreferencethesamevirtualkeyforconvenience.
11.
2MainUserModules11.
2.
1pywinauto.
applicationmoduleTheapplicationmoduleisthemainonethatuserswilluserst.
WhenstartingtoautomateanapplicationyoumustinitializeaninstanceoftheApplicationclass.
ThenyoumustApplication.
start()thatapplicationorApplication.
connect()toarunninginstanceofthatapplica-tion.
OnceyouhaveanApplicationinstanceyoucanaccessdialogsinthatapplicationeitherbyusingoneofthemethodsbelow.
dlg=app.
YourDialogTitledlg=app.
child_window(title="yourtitle",classname="yourclass",.
.
.
)dlg=app['YourDialogTitle']Similarlyonceyouhaveadialogyoucangetacontrolfromthatdialoginalmostexactlythesameways.
ctrl=dlg.
YourControlTitlectrl=dlg.
child_window(title="Yourcontrol",classname="Button",.
.
.
)ctrl=dlg["Yourcontrol"]Note:Forattributeaccessofcontrolsanddialogsyoudonothavetohavethetitleofthecontrolexactly,itdoesabestmatchoftheavailabledialogsorcontrols.
Seealso:pywinauto.
findwindows.
find_elements()forthekeywordargumentsthatcanbepassedtoboth:Application.
window()andWindowSpecification.
child_window()exceptionpywinauto.
application.
AppNotConnectedBases:ExceptionApplicationhasnotbeenconnectedtoaprocessyetexceptionpywinauto.
application.
AppStartErrorBases:ExceptionTherewasaproblemstartingtheApplicationclasspywinauto.
application.
Application(backend='win32',datalename=None,al-low_magic_lookup=True)Bases:objectRepresentsanapplication__getattribute__(attr_name)__getitem__(key)FindthespecieddialogoftheapplicationGetMatchHistoryItem(index)Shouldnotbeused-partofapplicationdataimplementation11.
2.
MainUserModules65pywinautoDocumentation,Release0.
6.
8WriteAppData(lename)Shouldnotbeused-partofapplicationdataimplementationactive()ReturnWindowSpecicationforanactivewindowoftheapplicationconnect(**kwargs)ConnecttoanalreadyrunningprocessTheactionisperformedaccordingtoonlyoneofparametersParametersprocess–aprocessIDofthetargethandle–awindowhandleofthetargetpath–apathusedtolaunchthetargettimeout–atimeoutforprocessstart(relevantifpathisspecied)Seealso:pywinauto.
findwindows.
find_elements()-thekeywordargumentsthatarealsocanbeusedinsteadofprocess,handleorpathcpu_usage(interval=None)ReturnCPUusagepercentduringspeciednumberofsecondsis64bit()ReturnTrueifrunningprocessis64-bitis_process_running()Checkthatprocessisrunning.
Canbecalledbeforestart/connect.
ReturnTrueifprocessisrunningotherwise-False.
kill(soft=False)Trytoclose(optional)andkilltheapplicationDialogsmaypopupaskingtosavedata-buttheapplicationwillbekilledanyway-youwillnotbeabletoclickthebuttons.
ThisshouldonlybeusedwhenitisOKtokilltheprocesslikeyouwoulddointaskmanager.
start(cmd_line,timeout=None,retry_interval=None,create_new_console=False,wait_for_idle=True,work_dir=None)Starttheapplicationasspeciedbycmd_linetop_window()ReturnWindowSpecicationforacurrenttopwindowoftheapplicationwait_cpu_usage_lower(threshold=2.
5,timeout=None,usage_interval=None)WaituntilprocessCPUusagepercentageislessthanthespeciedthresholdwait_for_process_exit(timeout=None,retry_interval=None)WaitsforprocesstoexituntiltimeoutreachesRaisesTimeoutErrorexceptioniftimeoutwasreachedwindow(**kwargs)ReturnawindowoftheapplicationYoucanspecifythesameparametersasndwindows.
nd_windows.
Itwilladdtheprocessparametertoensurethatthewindowisfromthecurrentprocess.
66Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8Seepywinauto.
findwindows.
find_elements()forthefullparametersdescription.
windows(**kwargs)Returnalistofwrappedtoplevelwindowsoftheapplicationpywinauto.
application.
AssertValidProcess(process_id)RaiseProcessNotFounderrorifprocess_idisnotavalidprocessidexceptionpywinauto.
application.
ProcessNotFoundErrorBases:ExceptionCouldnotndthatprocessclasspywinauto.
application.
WindowSpecification(search_criteria,al-low_magic_lookup=True)Bases:objectAspecicationforndingawindoworcontrolWindowsareresolvedwhenused.
Youcanalsowaitforexistanceornonexistanceofawindow__getattribute__(attr_name)AttributeaccessforthisclassIfwealreadyhavecriteriaforbothdialogandcontrolthenresolvethecontrolandreturntherequestedattribute.
IfwehaveonlycriteriaforthedialogbuttheattributerequestedisanattributeofDialogWrapperthenresolvethedialogandreturntherequestedattribute.
Otherwisedelegatefunctionalityto__getitem__()-whichsetstheappropriatecriteriaforthecontrol.
__getitem__(key)Allowaccesstodialogs/controlsthroughitemaccessThisallows:app['DialogTitle']['ControlTextClass']tobeusedtoaccessdialogsandcontrols.
Boththisand__getattribute__()usetherulesoutlinedintheHowTodocument.
WAIT_CRITERIA_MAP={'exists':('exists',),'visible':('is_visible',),'enabled':('is_enabled',),'ready':('is_visible','is_echild_window(**criteria)AddcriteriaforacontrolWhenthiswindowspecicationisresolveditwillbeusedtomatchagainstacontrol.
dump_tree(depth=None,lename=None)Printsthe'identiers'Printsidentiersforthecontrolandforitsdescendantstoadepthofdepth(thewholesubtreeifNone).
Note:Theidentiersprintedbythismethodhavebeenmadeunique.
Soifyouhave2editboxes,theywon'tbothhave"Edit"listedintheiridentiers.
Infacttherstonecanbereferredtoas"Edit","Edit0","Edit1"andthe2ndshouldbereferredtoas"Edit2".
exists(timeout=None,retry_interval=None)Checkifthewindowexists,returnTrueifthecontrolexistsParameters11.
2.
MainUserModules67pywinautoDocumentation,Release0.
6.
8timeout–themaximumamountoftimetowaitforthecontroltoexists.
DefaultstoTimings.
exists_timeoutretry_interval–Thecontrolischeckedforexistancethisnumberofseconds.
DefaultstoTimings.
exists_retryprint_control_identifiers(depth=None,lename=None)Printsthe'identiers'Printsidentiersforthecontrolandforitsdescendantstoadepthofdepth(thewholesubtreeifNone).
Note:Theidentiersprintedbythismethodhavebeenmadeunique.
Soifyouhave2editboxes,theywon'tbothhave"Edit"listedintheiridentiers.
Infacttherstonecanbereferredtoas"Edit","Edit0","Edit1"andthe2ndshouldbereferredtoas"Edit2".
print_ctrl_ids(depth=None,lename=None)Printsthe'identiers'Printsidentiersforthecontrolandforitsdescendantstoadepthofdepth(thewholesubtreeifNone).
Note:Theidentiersprintedbythismethodhavebeenmadeunique.
Soifyouhave2editboxes,theywon'tbothhave"Edit"listedintheiridentiers.
Infacttherstonecanbereferredtoas"Edit","Edit0","Edit1"andthe2ndshouldbereferredtoas"Edit2".
wait(wait_for,timeout=None,retry_interval=None)Waitforthewindowtobeinaparticularstate/states.
Parameterswait_for–Thestatetowaitforthewindowtobein.
Itcanbeanyofthefollowingstates,alsoyoumaycombinethestatesbyspacekey.
–'exists'meansthatthewindowisavalidhandle–'visible'meansthatthewindowisnothidden–'enabled'meansthatthewindowisnotdisabled–'ready'meansthatthewindowisvisibleandenabled–'active'meansthatthewindowisactivetimeout–Raiseanpywinauto.
timings.
TimeoutError()ifthewin-dowisnotintheappropriatestateafterthisnumberofseconds.
Default:pywinauto.
timings.
Timings.
window_find_timeout.
retry_interval–Howlongtosleepbetweeneachretry.
Default:pywinauto.
timings.
Timings.
window_find_retry.
Anexampletowaituntilthedialogexists,isready,enabledandvisible:self.
Dlg.
wait("existsenabledvisibleready")Seealso:WindowSpecification.
wait_not()pywinauto.
timings.
TimeoutError()wait_not(wait_for_not,timeout=None,retry_interval=None)Waitforthewindowtonotbeinaparticularstate/states.
68Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8Parameterswait_for_not–Thestatetowaitforthewindowtonotbein.
Itcanbeanyofthefollowingstates,alsoyoumaycombinethestatesbyspacekey.
–'exists'meansthatthewindowisavalidhandle–'visible'meansthatthewindowisnothidden–'enabled'meansthatthewindowisnotdisabled–'ready'meansthatthewindowisvisibleandenabled–'active'meansthatthewindowisactivetimeout–Raiseanpywinauto.
timings.
TimeoutError()ifthewindowissillinthestateafterthisnumberofseconds.
Default:pywinauto.
timings.
Timings.
window_find_timeout.
retry_interval–Howlongtosleepbetweeneachretry.
Default:pywinauto.
timings.
Timings.
window_find_retry.
Anexampletowaituntilthedialogisnotready,enabledorvisible:self.
Dlg.
wait_not("enabledvisibleready")Seealso:WindowSpecification.
wait()pywinauto.
timings.
TimeoutError()window(**criteria)Deprecatedaliasofchild_window()wrapper_object()AllowthecallingcodetogettheHwndWrapperobjectpywinauto.
application.
assert_valid_process(process_id)RaiseProcessNotFounderrorifprocess_idisnotavalidprocessidpywinauto.
application.
process_from_module(module)Returntherunningprocesswithpathmodulepywinauto.
application.
process_get_modules()Returnthelistofprocessesastuples(pid,exe_path)pywinauto.
application.
process_module(process_id)Returnthestringmodulenameofthisprocess11.
2.
2pywinauto.
ndbestmatchModuletondtheclosestmatchofastringinalistexceptionpywinauto.
findbestmatch.
MatchError(items=None,tond='')Asuitablematchcouldnotbefoundclasspywinauto.
findbestmatch.
UniqueDictAdictionarysubclassthathandlesmakingitskeysuniquefind_best_matches(search_text,clean=False,ignore_case=False)Returnthebestmatchesforsearch_textintheitemssearch_textthetexttolookforcleanwhethertocleannontextcharactersoutofthestrings11.
2.
MainUserModules69pywinautoDocumentation,Release0.
6.
8ignore_casecomparestringscaseinsensitivelypywinauto.
findbestmatch.
build_unique_dict(controls)BuildthedisambiguatedlistofcontrolsSeparatedouttoadifferentfunctionsothatwecangetthecontrolidentiersforprinting.
pywinauto.
findbestmatch.
find_best_control_matches(search_text,controls)Returnsthecontrolthatisthethebestmatchtosearch_textThisisslightlydifferntfromnd_best_matchinthatitbuildsupthelistoftextitemstosearchthroughusinginformationfromeachcontrol.
SoforexampleforthereisanOK,Buttonthenthefollowingarealladdedtothesearchlist:"OK","Button","OKButton"ButifthereisaListView(whichdonothavevisible'text')thenitwilljustadd"ListView".
pywinauto.
findbestmatch.
find_best_match(search_text,item_texts,items,limit_ratio=0.
5)Returntheitemthatbestmatchesthesearch_textsearch_textThetexttosearchforitem_textsThelistoftextstosearchthroughitemsThelistofitemscorresponding(1to1)tothelistoftextstosearchthrough.
limit_ratioHowwellthetexthastomatchthebestmatch.
IfthebestmatchmatcheslowerthenthisthenitisnotconsideredamatchandaMatchErrorisraised,(default=.
5)pywinauto.
findbestmatch.
get_control_names(control,allcontrols,textcontrols)Returnsalistofnamesforthiscontrolpywinauto.
findbestmatch.
get_non_text_control_name(ctrl,controls,text_ctrls)returnthenameforthiscontrolbyndingtheclosesttextcontrolaboveandtoitsleftpywinauto.
findbestmatch.
is_above_or_to_left(ref_control,other_ctrl)Returntrueiftheother_ctrlisaboveortotheleftofref_control11.
2.
3pywinauto.
ndwindowsProvidesfunctionsforiteratingandndingwindows/elementsexceptionpywinauto.
findwindows.
ElementAmbiguousErrorTherewasmorethenoneelementthatmatchedexceptionpywinauto.
findwindows.
ElementNotFoundErrorNoelementcouldbefoundexceptionpywinauto.
findwindows.
WindowAmbiguousErrorTherewasmorethenonewindowthatmatchedexceptionpywinauto.
findwindows.
WindowNotFoundErrorNowindowcouldbefoundpywinauto.
findwindows.
enum_windows()Returnalistofhandlesofallthetoplevelwindowspywinauto.
findwindows.
find_element(**kwargs)Callnd_elementsandensurethatonlyoneelementisreturnedCallsnd_elementswithexactlythesameargumentsasitiscalledwithsopleaseseefind_elements()forthefullparametersdescription.
70Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8pywinauto.
findwindows.
find_elements(class_name=None,class_name_re=None,parent=None,process=None,title=None,title_re=None,top_level_only=True,vis-ible_only=True,enabled_only=False,best_match=None,handle=None,ctrl_index=None,found_index=None,predicate_func=None,active_only=False,control_id=None,control_type=None,auto_id=None,framework_id=None,back-end=None,depth=None)FindelementsbasedoncriteriapassedinWARNING!
Directusageofthisfunctionisnotrecommended!
It'saverylowlevelAPI.
BetteruseApplicationandWindowSpecicationobjectsdescribedintheGettingStartedGuide.
Possiblevaluesare:class_nameElementswiththiswindowclassclass_name_reElementswhoseclassmatchesthisregularexpressionparentElementsthatarechildrenofthisprocessElementsrunninginthisprocesstitleElementswiththistexttitle_reElementswhosetextmatchesthisregularexpressiontop_level_onlyToplevelelementsonly(default=**True**)visible_onlyVisibleelementsonly(default=**True**)enabled_onlyEnabledelementsonly(default=False)best_matchElementswithatitlesimilartothishandleThehandleoftheelementtoreturnctrl_indexTheindexofthechildelementtoreturnfound_indexTheindexofthelteredoutchildelementtoreturnpredicate_funcAuserprovidedhookforacustomelementvalidationactive_onlyActiveelementsonly(default=False)control_idElementswiththiscontrolidcontrol_typeElementswiththiscontroltype(string;forUIAutomationelements)auto_idElementswiththisautomationid(forUIAutomationelements)framework_idElementswiththisframeworkid(forUIAutomationelements)backendBack-endnametousewhilesearching(default=Nonemeanscurrentactivebackend)pywinauto.
findwindows.
find_window(**kwargs)Callnd_elementsandensurethatonlyhandleofoneelementisreturnedCallsnd_elementswithexactlythesameargumentsasitiscalledwithsopleaseseefind_elements()forthefullparametersdescription.
pywinauto.
findwindows.
find_windows(**kwargs)Findelementsbasedoncriteriapassedinandreturnlistoftheirhandles11.
2.
MainUserModules71pywinautoDocumentation,Release0.
6.
8Callsnd_elementswithexactlythesameargumentsasitiscalledwithsopleaseseefind_elements()forthefullparametersdescription.
11.
2.
4pywinauto.
timingsGlobaltimingsettingsforallofpywinautoThismodulehasoneobjectthatshouldbeusedforalltimingadjustments:timings.
TimingsThereareacoupleofpredenedsettings:timings.
Timings.
fast()timings.
Timings.
defaults()timings.
Timings.
slow()TheFollowingaretheindividualtimingsettingsthatcanbeadjusted:window_nd_timeout(default5)window_nd_retry(default.
09)app_start_timeout(default10)app_start_retry(default.
90)app_connect_timeout(default5.
)app_connect_retry(default.
1)cpu_usage_interval(default.
5)cpu_usage_wait_timeout(default20)exists_timeout(default.
5)exists_retry(default.
3)after_click_wait(default.
09)after_clickinput_wait(default.
09)after_menu_wait(default.
1)after_sendkeys_key_wait(default.
01)after_button_click_wait(default0)before_closeclick_wait(default.
1)closeclick_retry(default.
05)closeclick_dialog_close_wait(default2)after_closeclick_wait(default.
2)after_windowclose_timeout(default2)after_windowclose_retry(default.
5)after_setfocus_wait(default.
06)setfocus_timeout(default2)setfocus_retry(default.
1)72Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8after_setcursorpos_wait(default.
01)sendmessagetimeout_timeout(default.
01)after_tabselect_wait(default.
05)after_listviewselect_wait(default.
01)after_listviewcheck_waitdefault(.
001)listviewitemcontrol_timeoutdefault(1.
5)after_treeviewselect_waitdefault(.
1)after_toobarpressbutton_waitdefault(.
01)after_updownchange_waitdefault(.
1)after_movewindow_waitdefault(0)after_buttoncheck_waitdefault(0)after_comboboxselect_waitdefault(.
001)after_listboxselect_waitdefault(0)after_listboxfocuschange_waitdefault(0)after_editsetedittext_waitdefault(0)after_editselect_waitdefault(.
02)drag_n_drop_move_mouse_waitdefault(.
1)before_drag_waitdefault(.
2)before_drop_waitdefault(.
1)after_drag_n_drop_waitdefault(.
1)scroll_step_waitdefault(.
1)classpywinauto.
timings.
TimeConfigCentralstorageandmanipulationoftimingvaluesDefaults(*args,**kwargs)Fast(*args,**kwargs)Slow(*args,**kwargs)defaults()Setalltimingstothedefaulttimefast()SetfasttimingvaluesCurrentlythischangesthetiminginthefollowingways:timeouts=1secondwaits=0secondsretries=.
001seconds(minimum!
)(ifexistingtimesarefasterthenkeepexistingtimes)slow()SetslowtimingvaluesCurrentlythischangesthetiminginthefollowingways:timeouts=defaulttimeouts*10waits=defaultwaits*3retries=defaultretries*3(ifexistingtimesareslowerthenkeepexistingtimes)11.
2.
MainUserModules73pywinautoDocumentation,Release0.
6.
8exceptionpywinauto.
timings.
TimeoutErrorpywinauto.
timings.
always_wait_until(timeout,retry_interval,value=True,op=)Decoratortocallwait_until(.
.
.
)everytimeforadecoratedfunction/methodpywinauto.
timings.
always_wait_until_passes(timeout,retry_interval,excep-tions=)Decoratortocallwait_until_passes(.
.
.
)everytimeforadecoratedfunction/methodpywinauto.
timings.
timestamp()Getaprecisetimestamppywinauto.
timings.
wait_until(timeout,retry_interval,func,value=True,op=,*args,**kwargs)Waituntilop(function(*args,**kwargs),value)isTrueoruntiltimeoutexpirestimeouthowlongthefunctionwilltrythefunctionretry_intervalhowlongtowaitbetweenretriesfuncthefunctionthatwillbeexecutedvaluethevaluetobecomparedagainst(defaultstoTrue)opthecomparisonfunction(defaultstoequality)argsoptionalargumentstobepassedtofuncwhencalledkwargsoptionalkeywordargumentstobepassedtofuncwhencalledReturnsthereturnvalueofthefunctionIftheoperationtimesoutthenthereturnvalueofthethefunctionisinthe'function_value'attributeoftheraisedexception.
e.
g.
try:#waitamaximumof10.
5secondsforthe#theobjectsitem_count()methodtoreturn10#inincrementsof.
5ofasecondwait_until(10.
5,.
5,self.
item_count,10)exceptTimeoutErrorase:print("timedout")pywinauto.
timings.
wait_until_passes(timeout,retry_interval,func,excep-tions=,*args,**kwargs)Waituntilfunc(*args,**kwargs)doesnotraiseoneoftheexceptionstimeouthowlongthefunctionwilltrythefunctionretry_intervalhowlongtowaitbetweenretriesfuncthefunctionthatwillbeexecutedexceptionslistofexceptionstotestagainst(default:Exception)argsoptionalargumentstobepassedtofuncwhencalledkwargsoptionalkeywordargumentstobepassedtofuncwhencalledReturnsthereturnvalueofthefunctionIftheoperationtimesoutthentheoriginalexceptionraisedisinthe'original_exception'attributeoftheraisedexception.
e.
g.
74Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8try:#waitamaximumof10.
5secondsforthe#windowtobefoundinincrementsof.
5ofasecond.
#P.
intamessageandre-raisetheoriginalexceptionifneverfound.
wait_until_passes(10.
5,.
5,self.
Exists,(ElementNotFoundError))exceptTimeoutErrorase:print("timedout")raisee.
11.
3SpecicFunctionality11.
3.
1pywinauto.
clipboardSomeclipboardwrappingfunctions-moretobeaddedlaterpywinauto.
clipboard.
EmptyClipboard()pywinauto.
clipboard.
GetClipboardFormats()Getalistoftheformatscurrentlyintheclipboardpywinauto.
clipboard.
GetData(format_id=)Returnthedatafromtheclipboardintherequestedformatpywinauto.
clipboard.
GetFormatName(format_id)Getthestringnameforaformatvalue11.
3.
2pywinauto.
win32_hooksWindowsglobalhooksinpurePythonTheimplementationusesforeignfunctioninterface(FFI)providedbystandardPythonmodulectypesandinspiredbypyHook,pyhookedandothersimilarmodules(thecodewasre-writtenfromscratch).
IttendstobeasupersetofpyHookbutinpurePythononlysoitdoesn'trequirecompilation.
Currentsetofhooksimplemented:WH_MOUSE_LLWH_KEYBOARD_LLMoredetaileddocumentationaboutWindowshookscanbefoundinMSDN:https://msdn.
microsoft.
com/en-us/library/windows/desktop/ms632589.
aspxThismodulecanbeusedasastandaloneoralongwithpywinauto.
Theforkofthiscode(atsomemoment)wasusedinstandalonelibrarypyhooked0.
8maintainedbyEthanSmith.
classpywinauto.
win32_hooks.
HookHookforlowlevelkeyboardandmouseeventshook(keyboard=True,mouse=False)Hookmouseand/orkeyboardeventsis_hooked()Verifyifanyofhooksareactive11.
3.
SpecicFunctionality75pywinautoDocumentation,Release0.
6.
8listen()Listenforeventsstop()Stopthelisteningloopunhook_keyboard()Unhookkeyboardeventsunhook_mouse()Unhookmouseeventsclasspywinauto.
win32_hooks.
KeyboardEvent(current_key=None,event_type=None,pressed_key=None)Createdwhenakeyboardeventhappenedclasspywinauto.
win32_hooks.
MouseEvent(current_key=None,event_type=None,mouse_x=0,mouse_y=0)Createdwhenamouseeventhappened11.
4ControlsReference11.
4.
1pywinauto.
base_wrapperBaseclassforallwrappersinallbackendsclasspywinauto.
base_wrapper.
BaseMetaAbstractmetaclassforWrapperobjectsstaticfind_wrapper(element)Abstractstaticmethodtondanappropriatewrapperclasspywinauto.
base_wrapper.
BaseWrapper(element_info,active_backend)Abstractwrapperforelements.
Allotherwrappersarederivedfromthis.
can_be_label=Falsecapture_as_image(rect=None)ReturnaPILimageofthecontrol.
SeePILdocumentationtoknowwhatyoucandowiththeresultingimage.
children(**kwargs)ReturnthechildrenofthiselementasalistItreturnsalistofBaseWrapper(orsubclass)instances.
Anemptylistisreturnediftherearenochildren.
class_name()Returntheclassnameoftheelenemtclick_input(button='left',coords=(None,None),button_down=True,button_up=True,double=False,wheel_dist=0,use_log=True,pressed='',absolute=False,key_down=True,key_up=True)ClickatthespeciedcoordinatesbuttonThemousebuttontoclick.
Oneof'left','right','middle'or'x'(Default:'left','move'isaspecialcase)coordsThecoordinatestoclickat.
(Default:thecenterofthecontrol)76Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8doubleWhethertoperformadoubleclickornot(Default:False)wheel_distThedistancetomovethemousewheel(default:0)NOTES:Thisisdifferentfromclickmethodinthatitrequiresthecontroltobevisibleonthescreenbutperformsamorerealistic'click'simulation.
Thismethodisalsovulnerableifthemouseismovedbytheuserasthatcouldeasilymovethemouseoffthecontrolbeforetheclick_inputhasnished.
client_to_screen(client_point)Mapspointfromclienttoscreencoordinatescontrol_count()Returnthenumberofchildrenofthiscontrolcontrol_id()ReturntheIDoftheelementOnlycontrolshaveavalidID-dialogsusuallyhavenoIDassigned.
TheIDusuallyidentiedthecontrolinthewindow-buttherecanbeduplicateID'sforexamplelablesinadialogmayhaveduplicateID's.
descendants(**kwargs)ReturnthedescendantsofthiselementasalistItreturnsalistofBaseWrapper(orsubclass)instances.
Anemptylistisreturnediftherearenodescendants.
double_click_input(button='left',coords=(None,None))Doubleclickatthespeciedcoordinatesdrag_mouse_input(dst=(0,0),src=None,button='left',pressed='',absolute=True)Clickonsrc,dragitanddropondstdstisadestinationwrapperobjectorjustcoordinates.
srcisasourcewrapperobjectorcoordinates.
IfsrcisNonetheselfisusedasasourceobject.
buttonisamousebuttontoholdduringthedrag.
Itcanbe"left","right","middle"or"x"pressedisakeyonthekeyboardtopressduringthedrag.
absolutespecieswhethertouseabsolutecoordinatesforthemousepointerlocationsdraw_outline(colour='green',thickness=2,ll=,rect=None)Drawanoutlinearoundthewindow.
colourcanbeeitheranintegeroroneof'red','green','blue'(default'green')thicknessthicknessofrectangle(default2)llhowtollintherectangle(defaultBS_NULL)rectthecoordinatesoftherectangletodraw(defaultstotherectangleofthecontrol)element_infoRead-onlypropertytogetElementInfoobjectfriendly_class_name()ReturnthefriendlyclassnameforthecontrolThisdiffersfromtheclassofthecontrolinsomecases.
class_name()istheactual'Registered'elementclassofthecontrolwhilefriendly_class_name()ishopefullysomethingthatwillmakemoresensetotheuser.
ForexampleCheckboxesareimplementedasButtons-sotheclassofaCheckBoxis"Button"-butthefriendlyclassis"CheckBox"11.
4.
ControlsReference77pywinautoDocumentation,Release0.
6.
8friendlyclassname=Nonefrom_point(x,y)Getwrapperobjectforelementatspeciedscreencoordinates(x,y)get_properties()Returnthepropertiesofthecontrolasadictionary.
has_title=Trueis_child(parent)ReturnTrueifthiselementisachildof'parent'.
Anelementisachildofanotherelementwhenitisadirectoftheotherelement.
Anelementisadirectdescendantofagivenelementiftheparentelementisthethechainofparentelementsforthechildelement.
is_dialog()ReturnTrueifthecontrolisatoplevelwindowis_enabled()WhethertheelementisenabledornotChecksthatboththetoplevelparent(probablydialog)thatownsthiselementandtheelementitselfarebothenabled.
Ifyouwanttowaitforanelementtobecomeenabled(orwaitforittobecomedisabled)useApplication.
wait('visible')orApplication.
wait_not('visible').
IfyouwanttoraiseanexceptionimmediatelyifanelementisnotenabledthenyoucanusetheBaseWrapper.
verify_enabled().
BaseWrapper.
VerifyReady()raisesifthewindowisnotbothvisibleandenabled.
is_visible()WhethertheelementisvisibleornotChecksthatboththetoplevelparent(probablydialog)thatownsthiselementandtheelementitselfarebothvisible.
Ifyouwanttowaitforanelementtobecomevisible(orwaitforittobecomehidden)useApplication.
wait('visible')orApplication.
wait_not('visible').
IfyouwanttoraiseanexceptionimmediatelyifanelementisnotvisiblethenyoucanusetheBaseWrapper.
verify_visible().
BaseWrapper.
verify_actionable()raisesiftheelementisnotbothvisibleandenabled.
iter_children(**kwargs)IterateoverthechildrenofthiselementItreturnsageneratorofBaseWrapper(orsubclass)instances.
iter_descendants(**kwargs)IterateoverthedescendantsofthiselementItreturnsageneratorofBaseWrapper(orsubclass)instances.
move_mouse_input(coords=(0,0),pressed='',absolute=True)Movethemouseparent()ReturntheparentofthiselementNotethattheparentofacontrolisnotnecesarilyadialogorothermainwindow.
Agroupboxmaybetheparentofsomeradiobuttonsforexample.
78Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8Togetthemain(ortoplevel)windowthenuseBaseWrapper.
top_level_parent().
press_mouse_input(button='left',coords=(None,None),pressed='',absolute=True,key_down=True,key_up=True)PressamousebuttonusingSendInputprocess_id()ReturntheIDofprocessthatownsthiswindowrectangle()ReturntherectangleofelementTherectangle()istherectangleoftheelementonthescreen.
Coordinatesaregivenfromthetopleftofthescreen.
ThismethodreturnsaRECTstructure,Whichhasattributes-top,left,right,bottom.
andhasmethodswidth()andheight().
Seewin32structures.
RECTformoreinformation.
release_mouse_input(button='left',coords=(None,None),pressed='',absolute=True,key_down=True,key_up=True)Releasethemousebuttonright_click_input(coords=(None,None))Rightclickatthespeciedcoordsroot()Returnwrapperforrootelement(desktop)set_focus()Setthefocustothiselementtexts()ReturnthetextforeachitemofthiscontrolItisalistofstringsforthecontrol.
Itisfrequentlyoverriddentoextractallstringsfromacontrolwithmultipleitems.
Itisalwaysalistwithoneormorestrings:TherstelementisthewindowtextofthecontrolSubsequentelementscontainthetextofanyitemsofthecontrol(e.
g.
itemsinalist-box/combobox,tabsinatabcontrol)top_from_point(x,y)Getwrapperobjectfortoplevelelementatspeciedscreencoordinates(x,y)top_level_parent()ReturnthetoplevelwindowofthiscontrolTheTopLevelparentisdifferentfromtheparentinthattheparentistheelementthatownsthiselement-butitmaynotbeadialog/mainwindow.
ForexamplemostComboboxeshaveanEdit.
TheComboBoxistheparentoftheEditcontrol.
Thiswillalwaysreturnavalidwindowelement(ifthecontrolhasnotoplevelparentthenthecontrolitselfisreturned-asitisatoplevelwindowalready!
)type_keys(keys,pause=None,with_spaces=False,with_tabs=False,with_newlines=False,turn_off_numlock=True,set_foreground=True,vk_packet=True)Typekeystotheelementusingkeyboard.
send_keysThisusesthere-writtenkeyboardpythonmodulewhereyoucannddocumentationonwhattouseforthekeys.
verify_actionable()Verifythattheelementisbothvisibleandenabled11.
4.
ControlsReference79pywinautoDocumentation,Release0.
6.
8RaiseeitherElementNotEnalbedorElementNotVisibleifnotenabledorvisiblerespectively.
verify_enabled()VerifythattheelementisenabledCheckrstiftheelement'sparentisenabled(skipifnoparent),thencheckifelementitselfisenabled.
verify_visible()VerifythattheelementisvisibleCheckrstiftheelement'sparentisvisible.
(skipifnoparent),thencheckifelementitselfisvisible.
wait_for_idle()Backendspecicfunctiontowaitforidlestateofathreadorawindowwas_maximized()Indicatewhetherthewindowwasmaximizedbeforeminimizingornotwheel_mouse_input(coords=(None,None),wheel_dist=1,pressed='')Domousewheelwindow_text()WindowtextoftheelementQuiteafewcontorlshaveothertextthatisvisible,forexampleEditcontrolsusuallyhaveanemptystringforwindow_textbutstillhavetextdisplayedintheeditwindow.
windowclasses=[]writable_propsBuildthelistofthedefaultpropertiestobewritten.
Derivedclassesmayoverrideorextendthislistdependingonhowmuchcontroltheyneed.
exceptionpywinauto.
base_wrapper.
ElementNotEnabledRaisedwhenanelementisnotenabledexceptionpywinauto.
base_wrapper.
ElementNotVisibleRaisedwhenanelementisnotvisibleexceptionpywinauto.
base_wrapper.
InvalidElementRaiseswhenaninvalidelementispassedpywinauto.
base_wrapper.
remove_non_alphanumeric_symbols(s)Maketextusableforattributename11.
4.
2pywinauto.
controls.
hwndwrapperBasicwrappingofWindowscontrolsexceptionpywinauto.
controls.
hwndwrapper.
ControlNotEnabledBases:RuntimeErrorRaisedwhenacontrolisnotenabledexceptionpywinauto.
controls.
hwndwrapper.
ControlNotVisibleBases:RuntimeErrorRaisedwhenacontrolisnotvisible80Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8classpywinauto.
controls.
hwndwrapper.
DialogWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapadialogClientAreaRect(*args,**kwargs)HideFromTaskbar(*args,**kwargs)IsInTaskbar(*args,**kwargs)RunTests(*args,**kwargs)ShowInTaskbar(*args,**kwargs)WriteToXML(*args,**kwargs)can_be_label=Trueclient_area_rect()ReturntheclientarearectangleFromMSDN:Theclientareaofacontrolistheboundsofthecontrol,minusthenonclientelementssuchasscrollbars,borders,titlebars,andmenus.
force_close()ClosethedialogforcefullyusingWM_QUERYENDSESSIONandreturntheresultWindowhasletusknowthatitdoesn'twanttodie-soweabortthismeansthattheappisnothung-butknowsitdoesn'twanttocloseyet-e.
g.
itisaskingtheuseriftheywanttosave.
friendlyclassname='Dialog'hide_from_taskbar()HidethedialogfromtheWindowstaskbaris_in_taskbar()CheckwhetherthedialogisshownintheWindowstaskbarThankstoDavidHeffernanfortheidea:http://stackoverow.
com/questions/30933219/hide-window-from-taskbar-without-using-ws-ex-toolwindowAwindowisrepresentedinthetaskbarif:IthasnoowneranditdoesnothavetheWS_EX_TOOLWINDOWextendedstyle,orithastheWS_EX_APPWINDOWextendedstyle.
run_tests(tests_to_run=None,ref_controls=None)Runthetestsondialogshow_in_taskbar()ShowthedialogintheWindowstaskbarwrite_to_xml(lename)WritethedialoganXMLle(requireselementtree)classpywinauto.
controls.
hwndwrapper.
HwndMeta(name,bases,attrs)Bases:pywinauto.
base_wrapper.
BaseMetaMetaclassforHwndWrapperobjectsstaticfind_wrapper(element)Findthecorrectwrapperforthisnativeelementclasspywinauto.
controls.
hwndwrapper.
HwndWrapper(element_info)Bases:pywinauto.
base_wrapper.
BaseWrapperDefaultwrapperforcontrols.
11.
4.
ControlsReference81pywinautoDocumentation,Release0.
6.
8Allotherwrappersarederivedfromthis.
ThisclasswrapsalotoffunctionalityofunderlyingwindowsAPIfeaturesforworkingwithwin-dows.
Mostofthemethodsapplytoeverysinglewindowtype.
Forexampleyoucanclick()onanywindow.
MostofthemethodsofthisclassaresimplewrappersaroundAPIcallsandassuchtheytrydothesimplestthingpossible.
AnHwndWrapperobjectcanbepasseddirectlytoactypeswrappedCfunction-anditwillgetconvertedtoaLongwiththevalueofit'shandle(seectypes,_as_parameter_).
automation_id()Returnthe.
NETnameofthecontrolclick(button='left',pressed='',coords=(0,0),double=False,absolute=False)SimulatesamouseclickonthecontrolThismethodsendsWM_*messagestothecontrol,todoamore'realistic'mouseclickuseclick_input()whichusesmouse_event()APItoperformtheclick.
Thismethoddoesnotrequirethatthecontrolbevisibleonthescreen(i.
e.
itcanbehiddenbeneathanotherwindowanditwillstillwork).
client_rect()ReturnstheclientrectangleofwindowTheclientrectangleisthewindowrectangleminusanybordersthatarenotavailabletothecontrolfordrawing.
Bothtopandleftarealways0forthismethod.
ThismethodreturnsaRECTstructure,Whichhasattributes-top,left,right,bottom.
andhasmethodswidth()andheight().
Seewin32structures.
RECTformoreinformation.
client_rects()ReturntheclientrectforeachiteminthiscontrolItisalistofrectanglesforthecontrol.
Itisfrequentlyover-riddentoextractallrectanglesfromacontrolwithmultipleitems.
Itisalwaysalistwithoneormorerectangles:FirstelemtentistheclientrectangleofthecontrolSubsequentelementscontaintheclientrectangleofanyitemsofthecontrol(e.
g.
itemsinalistbox/combobox,tabsinatabcontrol)close(wait_time=0)ClosethewindowCodemodiedfromhttp://msdn.
microsoft.
com/msdnmag/issues/02/08/CQA/close_alt_f4()ClosethewindowbypressingAlt+F4keys.
close_click(button='left',pressed='',coords=(0,0),double=False)PerformaclickactionthatshouldmakethewindowgoawayTheonlydifferencefromclickisthatthereareextradelaysbeforeandaftertheclickaction.
context_help_id()ReturntheContextHelpIDofthewindowcontrol_type()Returnthe.
NETtypeofthecontrol82Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8debug_message(text)Writesomedebugtextoverthewindowdouble_click(button='left',pressed='',coords=(0,0))Performadoubleclickactiondrag_mouse(button='left',press_coords=(0,0),release_coords=(0,0),pressed='')Dragthemouseexstyle()ReturnstheExtendedstyleofwindowReturnvalueisalong.
CombinationofWS_*andspeciccontrolspecicstyles.
SeeHwndWrapper.
has_style()toeasilycheckifthewindowhasaparticularstyle.
font()ReturnthefontofthewindowThefontofthewindowisusedtodrawthetextofthatwindow.
Itisastructurewhichhasattributesforfontname,height,widthetc.
Seewin32structures.
LOGFONTWformoreinformation.
fonts()ReturnthefontforeachiteminthiscontrolItisalistoffontsforthecontrol.
Itisfrequentlyover-riddentoextractallfontsfromacontrolwithmultipleitems.
Itisalwaysalistwithoneormorefonts:FirstelemtentisthecontrolfontSubsequentelementscontainthefontofanyitemsofthecontrol(e.
g.
itemsinalist-box/combobox,tabsinatabcontrol)full_control_type()Returnthe.
NETtypeofthecontrol(full,uncut)get_active()Returnahandletotheactivewindowwithintheprocessget_focus()ReturnthecontrolintheprocessofthiswindowthathastheFocusget_show_state()GettheshowstateandMaximized/minimzed/restoredstateReturnsavaluethatisaunionofthefollowingSW_HIDEthewindowishidden.
SW_MAXIMIZEthewindowismaximizedSW_MINIMIZEthewindowisminimizedSW_RESTOREthewindowisinthe'restored'state(neitherminimizedormaximized)SW_SHOWThewindowisnothiddenget_toolbar()Gettherstchildtoolbarifitexistshandle=Nonehas_exstyle(exstyle)ReturnTrueifthecontrolhasthespeciedextendedstyle11.
4.
ControlsReference83pywinautoDocumentation,Release0.
6.
8has_focus()Checkthewindowisinfocus(foreground)has_keyboard_focus()Checkthekeyboardfocusonthiscontrol.
has_style(style)ReturnTrueifthecontrolhasthespeciedstyleis_active()Whetherthewindowisactiveornotis_dialog()Returntrueifthecontrolisatoplevelwindowis_maximized()Indicatewhetherthewindowismaximizedornotis_minimized()Indicatewhetherthewindowisminimizedornotis_normal()Indicatewhetherthewindowisnormal(i.
e.
notminimizedandnotmaximized)is_unicode()WhetherthewindowisunicodeornotAwindowisUnicodeifitwasregisteredbytheWidecharversionofRegisterClass(Ex).
maximize()Maximizethewindowmenu()Returnthemenuofthecontrolmenu_item(path,exact=False)ReturnthemenuitemspeciedbypathPathcanbeastringintheform"MenuItem->MenuItem->MenuItem.
.
.
"whereeachMenuItemisthetextofanitematthatlevelofthemenu.
E.
g.
File->Export->ExportAsPNGspacesarenotimportantsoyoucouldalsohavewritten.
.
.
File->Export->ExportAsPNGmenu_items()ReturnthemenuitemsforthedialogIftherearenomenuitemsthenreturnanemptylistmenu_select(path,exact=False)FindamenuitemspeciedbythepathThefullpathsyntaxisspeciedin:controls.
menuwrapper.
Menu.
get_menu_path()minimize()Minimizethewindowmove_mouse(coords=(0,0),pressed='',absolute=False)MovethemousebyWM_MOUSEMOVE84Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8move_window(x=None,y=None,width=None,height=None,repaint=True)MovethewindowtothenewcoordinatesxSpeciesthenewleftpositionofthewindow.
Defaultstothecurrentleftpositionofthewindow.
ySpeciesthenewtoppositionofthewindow.
Defaultstothecurrenttoppositionofthewindow.
widthSpeciesthenewwidthofthewindow.
Defaultstothecurrentwidthofthewindow.
heightSpeciesthenewheightofthewindow.
Defaulttothecurrentheightofthewindow.
repaintWhetherthewindowshouldberepaintedornot.
DefaultstoTruenotify_parent(message,controlID=None)Sendthenoticationmessagetoparentofthiscontrolowner()ReturntheownerwindowforthewindowifitexistsReturnsNoneifthereisnoowner.
popup_window()ReturnownedenabledPopupwindowwrapperifshown.
Ifthereisnoenabledpopupsatthattime,itreturnsself.
SeeMSDNreference:https://msdn.
microsoft.
com/en-us/library/windows/desktop/ms633515.
aspxPleasedonotuseinproductioncodeyet-nottestedfullypost_command(commandID)post_message(message,wparam=0,lparam=0)Postamessagetothecontrolmessagequeueandreturnpress_mouse(button='left',coords=(0,0),pressed='')Pressthemousebuttonrelease_mouse(button='left',coords=(0,0),pressed='')Releasethemousebuttonrestore()Restorethewindowtoitspreviousstate(normalormaximized)right_click(pressed='',coords=(0,0))Performarightclickactionscroll(direction,amount,count=1,retry_interval=None)Askthecontroltoscrollitselfdirectioncanbeanyof"up","down","left","right"amountcanbeoneof"line","page","end"count(optional)thenumberoftimestoscrollsend_chars(chars,with_spaces=True,with_tabs=True,with_newlines=True)SilentlysendacharacterstringtothecontrolinaninactivewindowIfavirtualkeywithnocorrespondingcharacterisencountered(e.
g.
VK_LEFT,VK_DELETE),aKeySequenceErrorisraised.
Considerusingthemethodsend_keystrokesforsuchinput.
send_command(commandID)send_keystrokes(keystrokes,with_spaces=True,with_tabs=True,with_newlines=True)SilentlysendkeystrokestothecontrolinaninactivewindowItparsesmodiersShift(+),Control(^),Menu(%)andSequenceslike"{TAB}","{ENTER}"FormoreinformationaboutSequencesandModiersnavigatetomodulekeyboard11.
4.
ControlsReference85pywinautoDocumentation,Release0.
6.
8Duetothefactthateachapplicationhandlesinputdifferentlyandthismethodismeanttobeusedoninactivewindows,itmayworkonlypartiallydependingonthetargetapp.
Ifthewindowbeinginactiveisnotessential,usetherobusttype_keysmethod.
send_message(message,wparam=0,lparam=0)Sendamessagetothecontrolandwaitforittoreturnsend_message_timeout(message,wparam=0,lparam=0,time-out=None,timeoutags=)SendamessagetothecontrolandwaitforittoreturnortotimeoutIfnotimeoutisgiventhenadefaulttimeoutof.
01ofasecondwillbeused.
set_application_data(appdata)ApplicationdataisdatafromapreviousrunofthesoftwareItisessentialforrunningscriptswrittenforonespokelanguageonadifferentspokenlanguageset_focus()Setthefocustothiscontrol.
Bringthewindowtotheforegroundrst.
Thesystemrestrictswhichprocessescansettheforegroundwindow(https://msdn.
microsoft.
com/en-us/library/windows/desktop/ms633539(v=vs.
85).
aspx)sothemousecursorisremovedfromthescreentopreventanysideeffects.
set_keyboard_focus()Setthekeyboardfocustothiscontrol.
set_transparency(alpha=120)Setthewindowtransparencyfrom0to255byalphaattributeset_window_text(text,append=False)Setthetextofthewindowstyle()ReturnsthestyleofwindowReturnvalueisalong.
CombinationofWS_*andspeciccontrolspecicstyles.
SeeHwndWrapper.
has_style()toeasilycheckifthewindowhasaparticularstyle.
user_data()ExtradataassocitedwiththewindowThisvalueisalongvaluethathasbeenassociatedwiththewindowandrarelyhasusefuldata(oratleastdatathatyouknowtheuseof).
wait_for_idle()Backendspecicfunctiontowaitforidlestateofathreadorawindowwritable_propsExtenddefaultpropertieslist.
exceptionpywinauto.
controls.
hwndwrapper.
InvalidWindowHandle(hwnd)Bases:RuntimeErrorRaisedwhenaninvalidhandleispassedtoHwndWrapperpywinauto.
controls.
hwndwrapper.
get_dialog_props_from_handle(hwnd)Getthepropertiesofallthecontrolsasalistofdictionaries86Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
811.
4.
3pywinauto.
controls.
menuwrapperWrapperaroundMenu'sandMenuitemsThesewrappersallowyoutoworkeasilywithmenuitems.
Youcanselectorclickonitemsandcheckiftheyarecheckedorunchecked.
classpywinauto.
controls.
menuwrapper.
Menu(owner_ctrl,menuhan-dle,is_main_menu=True,owner_item=None)Bases:objectAsimplewrapperaroundamenuhandleAmenusupportsmethodsforqueryingthemenuandgettingit'smenuitems.
get_menu_path(path,path_items=None,appdata=None,exact=False)WalktheitemsinthismenutondtheitemspeciedbyapathThepathisspeciedbyalistofitemsseparatedby'->'.
Eachitemcanbeeitherastring(canincludespaces)e.
g.
"SaveAs"orazerobasedindexoftheitemtoreturnprefacedby#e.
g.
#1oranIDoftheitemprefacedby$specier.
Thesecanbemixedasnecessary.
Forexample:"#0->SaveAs","$23453->SaveAs","Tools->#0->Congure"Textmatchingisdoneusinga'bestmatch'fuzzyalgorithm,soyoudon'thavetoaddallpunctu-ation,ellipses,etc.
IDmatchingisperformedagainstwIDeldofMENUITEMINFOstructure(https://msdn.
microsoft.
com/en-us/library/windows/desktop/ms647578(v=vs.
85).
aspx)get_properties()ReturnthepropertiesforthemenuasalistofdictionariesThismethodisactuallyrecursive.
Itcallsget_properties()foreachoftheitems.
Iftheitemhasasubmenuitwillcallthisget_propertiestogetthesubmenuitems.
item(index,exact=False)Returnaspecicmenuitemindexisthe0basedindexortextofthemenuitemyouwant.
exactisTruemeansexactmatchingforitemtext,Falsemeansbestmatching.
item_count()Returnthecountofitemsinthismenuitems()Returnalistofalltheitemsinthismenuexceptionpywinauto.
controls.
menuwrapper.
MenuInaccessibleBases:RuntimeErrorRaisedwhenamenuhashandlebutinaccessible.
classpywinauto.
controls.
menuwrapper.
MenuInfoBases:objectAholderforMenuInfoclasspywinauto.
controls.
menuwrapper.
MenuItem(ctrl,menu,index,on_main_menu=False)Bases:objectWrapamenuitem11.
4.
ControlsReference87pywinautoDocumentation,Release0.
6.
8click()SelectthemenuitemThiswillsendamessagetotheparentwindowthattheitemwaspicked.
click_input()ClickonthemenuiteminamorerealisticwayIfthemenuisopenitwillclickwiththemouseeventontheitem.
Ifthemenuisnotopeneachofit'sparent'swillbeopeneduntiltheitemisvisible.
friendly_class_name()Returnfriendlyclassnameget_properties()ReturnthepropertiesfortheitemasadictIfthisitemopensasubmenuthencallMenu.
get_properties()toreturnthelistofitemsinthesubmenu.
Thisisavialableunderthe'menu_items'key.
index()Returntheindexofthismenuitemis_checked()ReturnTrueiftheitemischecked.
is_enabled()ReturnTrueiftheitemisenabled.
item_id()ReturntheIDofthismenuitemitem_type()ReturntheTypeofthismenuitemMaintypesareMF_STRING,MF_BITMAP,MF_SEPARATOR.
Seehttps://msdn.
microsoft.
com/en-us/library/windows/desktop/ms647980.
aspxforfurtherin-formation.
rectangle()Gettherectangleofthemenuitemselect()SelectthemenuitemThiswillsendamessagetotheparentwindowthattheitemwaspicked.
state()Returnthestateofthismenuitemsub_menu()ReturntheSubMenuorNoneifnosubmenutext()Returnthetextofthismenuitemclasspywinauto.
controls.
menuwrapper.
MenuItemInfoBases:objectAholderforMenuItemInfoexceptionpywinauto.
controls.
menuwrapper.
MenuItemNotEnabledBases:RuntimeError88Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8Raisedwhenamenuitemisnotenabledpywinauto.
controls.
menuwrapper.
ensure_accessible(method)DecoratorforMenuinstancemethods11.
4.
4pywinauto.
controls.
common_controlsClassesthatwraptheWindowsCommoncontrolsclasspywinauto.
controls.
common_controls.
_toolbar_button(index_,tb_handle)Bases:objectWrapperaroundToolbarbutton(TBBUTTONINFO)itemsclick(button='left',pressed='')ClickontheToolbarbuttonclick_input(button='left',double=False,wheel_dist=0,pressed='')ClickontheToolbarbuttonhas_style(style)ReturnTrueifthebuttonhasthespeciedstyleis_checkable()Returnifthebuttoncanbecheckedis_checked()Returnifthebuttonisinthecheckedstateis_enabled()Returnifthebuttonisinthepressedstateis_pressable()Returnifthebuttoncanbepressedis_pressed()Returnifthebuttonisinthepressedstaterectangle()Gettherectangleofabuttononthetoolbarstate()Returnthestateofthebuttonstyle()Returnthestyleofthebuttontext()Returnthetextofthebuttonclasspywinauto.
controls.
common_controls.
_treeview_element(elem,tv_handle)Bases:objectWrapperaroundTreeViewitemschildren()Returnthedirectchildrenofthiscontrolclick(button='left',double=False,where='text',pressed='')Clickonthetreeviewitemwherecanbeanyoneof"text","icon","button","check"defaultsto"text"11.
4.
ControlsReference89pywinautoDocumentation,Release0.
6.
8click_input(button='left',double=False,wheel_dist=0,where='text',pressed='')Clickonthetreeviewitemwherecanbeanyoneof"text","icon","button","check"defaultsto"text"client_rect(text_area_rect=True)ReturnarectangleofatextareaoftheitemIftext_area_rectissettoFalsethenitwillreturnarectangleforthewholeitem(usuallyleftisequalto0).
DefaultstoTrue-whichreturnsjusttherectangleofthetextoftheitemcollapse()Collapsethechildrenofthistreeviewitemdrop(button='left',pressed='')Dropattheitemensure_visible()MakesurethattheTreeViewitemisvisibleexpand()Expandthechildrenofthistreeviewitemget_child(child_spec,exact=False)ReturnthechilditemofthisitemAcceptseitherastringoranindex.
Ifastringispassedthenitreturnsthechilditemwiththebestmatchforthestring.
is_checked()ReturnwhethertheTreeViewitemischeckedornotis_expanded()IndicatethattheTreeViewitemisselectedornotis_selected()IndicatethattheTreeViewitemisselectedornotitem()Returntheitemitselfnext_item()Returnthenextitemselect()SelecttheTreeViewitemstart_dragging(button='left',pressed='')Startdraggingtheitemstate()Returnthestateoftheitemsub_elements()Returnthelistofchildrenofthiscontroltext()Returnthetextoftheitemclasspywinauto.
controls.
common_controls.
_listview_item(lv_ctrl,item_index,subitem_index=0)Bases:objectWrapperaroundListViewitems90Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8check()ChecktheListViewitemclick(button='left',double=False,where='text',pressed='')Clickonthelistviewitemwherecanbeanyoneof"all","icon","text","select","check"defaultsto"text"click_input(button='left',double=False,wheel_dist=0,where='text',pressed='')Clickonthelistviewitemwherecanbeanyoneof"all","icon","text","select","check"defaultsto"text"deselect()MarktheitemasnotselectedTheListViewcontrolmustbeenabledandvisiblebeforeanItemcanbeselectedotherwiseanexceptionisraisedensure_visible()MakesurethattheListViewitemisvisibleimage()Returntheimageindexoftheitemindent()Returntheindentoftheiteminplace_control(friendly_class_name='')ReturntheeditorHwndWrapperoftheitemPossiblefriendly_class_namevalues:""Returntherstappearedin-placecontrol"friendlyclassname"Returnseditorwithparticularfriendlyclassnameis_checked()ReturnwhethertheListViewitemischeckedornotis_focused()ReturnTrueiftheitemhasthefocusis_selected()ReturnTrueiftheitemisselecteditem()Returntheitemitself(LVITEMinstance)item_data()Returntheitemdata(dictionary)rectangle(area='all')Returntherectangleoftheitem.
Possibleareavalues:"all"Returnstheboundingrectangleoftheentireitem,includingtheiconandlabel.
"icon"Returnstheboundingrectangleoftheiconorsmallicon.
"text"Returnstheboundingrectangleoftheitemtext.
"select"Returnstheunionofthe"icon"and"text"rectangles,butexcludescolumnsinreportview.
11.
4.
ControlsReference91pywinautoDocumentation,Release0.
6.
8select()MarktheitemasselectedTheListViewcontrolmustbeenabledandvisiblebeforeanItemcanbeselectedotherwiseanexceptionisraisedstate()Returnthestateoftheitemtext()Returnthetextoftheitemuncheck()UnchecktheListViewitemclasspywinauto.
controls.
common_controls.
AnimationWrapper(element_info)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperClassthatwrapsWindowsAnimationcommoncontrolfriendlyclassname='Animation'windowclasses=['SysAnimate32']classpywinauto.
controls.
common_controls.
CalendarWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperClassthatwrapsWindowsCalendarcommoncontrolcalc_min_rectangle(left,top,right,bottom)Calculatestheminimumsizethatarectangleneedstobetotthatnumberofcalendarscount()Getthecalendarscountfriendlyclassname='Calendar'get_border()Getthecalendarborderget_current_date()Getthecurrentlyselecteddateget_first_weekday()Getisnotincurrentlocaleandifsorstdayoftheweekget_id()Gettypeofcalendarget_month_delta()Retrievesthescrollrateforamonthcalendarcontrolget_month_range(scope_of_range)Retrievesdateinformationthatrepresentsthehighandlowlimitsofamonthcalendarcontrol'sdisplay.
get_today()Gettodaydateget_view()Getthecalendarviewhas_title=Falsehit_test(x,y)Determineswhichportionofamonthcalendarcontrolisatagivenpointonthescreen92Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8place_in_calendar={'background':'eachItemcanbethezerobasedindexoftheitemtoreturnprefacedby#e.
g.
#1.
Example:"#1->#0","#1->#0->#0"press_button(button_identier,exact=True)Findwherethebuttonisandclickittexts()ReturnthetextsoftheToolbartip_texts()ReturnthetiptextsoftheToolbar(withoutwindowtext)windowclasses=['ToolbarWindow32','TToolBar','WindowsForms\\d*\\.
ToolbarWindow32\Afx:ToolBar:.
*']writable_propsExtenddefaultpropertieslist.
100Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8classpywinauto.
controls.
common_controls.
TrackbarWrapper(element_info)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperClassthatwrapsWindowsTrackbarcommoncontrolfriendlyclassname='Trackbar'get_channel_rect()GetpositionoftheboundingrectangleforaTrackbarget_line_size()Getthenumberoflogicalpositionsthetrackbar'ssliderget_num_ticks()Gettrackbarnumticksget_page_size()Getthenumberoflogicalpositionsforthetrackbar'ssliderget_position()Gettrackbarpositionget_range_max()Getmaxavailabletrackbarvalueget_range_min()Getminavailabletrackbarvalueget_sel_end()Getendofselectionget_sel_start()Getstartofselectionget_tooltips_control()Gettrackbartooltipset_line_size(line_size)Settrackbarlinesizeset_page_size(page_size)Settrackbarpagesizeset_position(pos)Settrackbarpositionset_range_max(range_max)Setmaxavailabletrackbarvalueset_range_min(range_min)Setminavailabletrackbarvalueset_sel(sel_start,sel_end)Setstartandendofselectionwindowclasses=['msctls_trackbar']classpywinauto.
controls.
common_controls.
TreeViewWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperClassthatwrapsWindowsTreeViewcommoncontrolEnsureVisible(*args,**kwargs)GetItem(*args,**kwargs)11.
4.
ControlsReference101pywinautoDocumentation,Release0.
6.
8IsSelected(*args,**kwargs)Item(*args,**kwargs)ItemCount(*args,**kwargs)PrintItems(*args,**kwargs)Root(*args,**kwargs)Roots(*args,**kwargs)Select(*args,**kwargs)ensure_visible(path)MakesurethattheTreeViewitemisvisiblefriendlyclassname='TreeView'get_item(path,exact=False)ReadtheTreeViewitempaththepathtotheitemtoreturn.
Thiscanbeoneofthefollowing:–Astringseparatedby\characters.
Therstcharactermustbe\.
Thisstringissplitonthe\charactersandeachoftheseisusedtondthespecicchildateachlevel.
The\representstherootitem-soyoudon'tneedtospecifytherootitself.
–Alist/tupleofstrings-Therstitemshouldbetherootelement.
–Alist/tupleofintegers-Therstitemtheindexwhichroottoselect.
get_properties()Getthepropertiesforthecontrolasadictionaryis_selected(path)ReturnTrueiftheitemisselecteditem(path,exact=False)ReadtheTreeViewitempaththepathtotheitemtoreturn.
Thiscanbeoneofthefollowing:–Astringseparatedby\characters.
Therstcharactermustbe\.
Thisstringissplitonthe\charactersandeachoftheseisusedtondthespecicchildateachlevel.
The\representstherootitem-soyoudon'tneedtospecifytherootitself.
–Alist/tupleofstrings-Therstitemshouldbetherootelement.
–Alist/tupleofintegers-Therstitemtheindexwhichroottoselect.
item_count()Returnthecountoftheitemsinthetreeviewprint_items()Printallitemswithlineindentsroots()Getrootitemsofthecontrolselect(path)Selectthetreeviewitemtexts()Returnallthetextforthetreeview102Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8tree_root()Returntherootelementofthetreeviewwindowclasses=['SysTreeView32','WindowsForms\\d*\\.
SysTreeView32\TTreeView','TreeList.
TreeListCtrl']writable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
common_controls.
UpDownWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperClassthatwrapsWindowsUpDowncommoncontrolDecrement(*args,**kwargs)GetBase(*args,**kwargs)GetBuddyControl(*args,**kwargs)GetRange(*args,**kwargs)GetValue(*args,**kwargs)Increment(*args,**kwargs)SetBase(*args,**kwargs)SetValue(*args,**kwargs)decrement()DecrementthenumberintheUpDowncontrolbyonefriendlyclassname='UpDown'get_base()GetthebasetheUpDowncontrol(either10or16)get_buddy_control()Getthebuddycontroloftheupdowncontrolget_range()Returnthelower,upperrangeoftheupdowncontrolget_value()GetthecurrentvalueoftheUpDowncontrolincrement()IncrementthenumberintheUpDowncontrolbyoneset_base(base_value)GetthebasetheUpDowncontrol(either10or16)set_value(new_pos)SetthevalueoftheoftheUpDowncontroltosomeintegervaluewindowclasses=['msctls_updown32','msctls_updown']11.
4.
5pywinauto.
controls.
win32_controlsWrapsvariousstandardwindowscontrolsclasspywinauto.
controls.
win32_controls.
ButtonWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapawindowsButtoncontrol11.
4.
ControlsReference103pywinautoDocumentation,Release0.
6.
8Check(*args,**kwargs)CheckByClick(*args,**kwargs)CheckByClickInput(*args,**kwargs)GetCheckState(*args,**kwargs)SetCheckIndeterminate(*args,**kwargs)UnCheck(*args,**kwargs)UncheckByClick(*args,**kwargs)UncheckByClickInput(*args,**kwargs)can_be_label=Truecheck()Checkacheckboxcheck_by_click()ChecktheCheckBoxcontrolbyclick()methodcheck_by_click_input()ChecktheCheckBoxcontrolbyclick_input()methodclick(button='left',pressed='',coords=(0,0),double=False,absolute=False)ClicktheButtoncontrolfriendly_class_name()ReturnthefriendlyclassnameofthebuttonWindowscontrolswiththeclass"Button"canlooklikedifferentcontrolsbasedontheirstyle.
Theycanlooklikethefollowingcontrols:Buttons,thismethodreturns"Button"CheckBoxes,thismethodreturns"CheckBox"RadioButtons,thismethodreturns"RadioButton"GroupBoxes,thismethodreturns"GroupBox"friendlyclassname='Button'get_check_state()ReturnthecheckstateofthecheckboxThecheckstateisrepresentedbyaninteger0-unchecked1-checked2-indeterminateThefollowingconstantsaredenedinthewin32denesmoduleBST_UNCHECKED=0BST_CHECKED=1BST_INDETERMINATE=2is_checked()ReturnTrueifchecked,Falseifnotchecked,Noneifindeterminateis_dialog()ButtonsareneverdialogssoreturnFalseset_check_indeterminate()Setthecheckboxtoindeterminateuncheck()Uncheckacheckboxuncheck_by_click()UnchecktheCheckBoxcontrolbyclick()method104Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8uncheck_by_click_input()UnchecktheCheckBoxcontrolbyclick_input()methodwindowclasses=['Button','.
*Button','WindowsForms\\d*\\.
BUTTON\CheckBox']classpywinauto.
controls.
win32_controls.
ComboBoxWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapawindowsComboBoxcontrolDroppedRect(*args,**kwargs)ItemCount(*args,**kwargs)ItemData(*args,**kwargs)ItemTexts(*args,**kwargs)Select(*args,**kwargs)SelectedIndex(*args,**kwargs)SelectedText(*args,**kwargs)dropped_rect()Getthedroppedrectangleofthecomboboxfriendlyclassname='ComboBox'get_properties()Returnthepropertiesofthecontrolasadictionaryhas_title=Falseitem_count()Returnthenumberofitemsinthecomboboxitem_data(item)Returnstheitemdataassociatedwiththeitemifanyitem_texts()Returnthetextoftheitemsofthecomboboxselect(item)SelecttheComboBoxitemitemcanbeeithera0basedindexoftheitemtoselectoritcanbethestringthatyouwanttoselectselected_index()Returntheselectedindexselected_text()Returntheselectedtexttexts()Returnthetextoftheitemsinthecomboboxwindowclasses=['ComboBox','WindowsForms\\d*\\.
COMBOBOX\ComboBox']writable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
win32_controls.
EditWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapawindowsEditcontrol11.
4.
ControlsReference105pywinautoDocumentation,Release0.
6.
8GetLine(*args,**kwargs)LineCount(*args,**kwargs)LineLength(*args,**kwargs)Select(*args,**kwargs)SelectionIndices(*args,**kwargs)SetEditText(*args,**kwargs)SetText(*args,**kwargs)TextBlock(*args,**kwargs)friendlyclassname='Edit'get_line(line_index)Returnthelinespeciedhas_title=Falseline_count()ReturnhowmanylinesthereareintheEditline_length(line_index)Returnhowmanycharactersthereareinthelineselect(start=0,end=None)Settheeditselectionoftheeditcontrolselection_indices()Thestartandendindicesofthecurrentselectionset_edit_text(text,pos_start=None,pos_end=None)Setthetextoftheeditcontrolset_text(text,pos_start=None,pos_end=None)Setthetextoftheeditcontrolset_window_text(text,append=False)Overrideset_window_textforeditcontrolsbecauseitshouldnotbeusedforEditcontrols.
EditControlsshouldeitheruseset_edit_text()ortype_keys()tomodifythecontentsoftheeditcontrol.
text_block()Getthetextoftheeditcontroltexts()Getthetextoftheeditcontrolwindowclasses=['Edit','.
*Edit','TMemo','WindowsForms\\d*\\.
EDIT\ThunderTextBox','ThunderRT6Twritable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
win32_controls.
ListBoxWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapawindowsListBoxcontrolGetItemFocus(*args,**kwargs)IsSingleSelection(*args,**kwargs)106Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8ItemCount(*args,**kwargs)ItemData(*args,**kwargs)ItemRect(*args,**kwargs)ItemTexts(*args,**kwargs)Select(*args,**kwargs)SelectedIndices(*args,**kwargs)SetItemFocus(*args,**kwargs)friendlyclassname='ListBox'get_item_focus()RetruntheindexofcurrentselectioninaListBoxhas_title=Falseis_single_selection()Checkwhetherthelistboxhassingleselectionmode.
item_count()ReturnthenumberofitemsintheListBoxitem_data(i)Returntheitem_dataifanyassocitedwiththeitemitem_rect(item)Returntherectoftheitemitem_texts()Returnthetextoftheitemsofthelistboxselect(item,select=True)SelecttheListBoxitemitemcanbeeithera0basedindexoftheitemtoselectoritcanbethestringthatyouwanttoselectselected_indices()Thecurrentlyselectedindicesofthelistboxset_item_focus(item)SettheListBoxfocustotheitematindextexts()Returnthetextsofthecontrolwindowclasses=['ListBox','WindowsForms\\d*\\.
LISTBOX\ListBox']writable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
win32_controls.
PopupMenuWrapper(element_info)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapaPopupMenufriendlyclassname='PopupMenu'has_title=Falseis_dialog()Returnwhetheritisadialog11.
4.
ControlsReference107pywinautoDocumentation,Release0.
6.
8windowclasses=['#32768']classpywinauto.
controls.
win32_controls.
StaticWrapper(hwnd)Bases:pywinauto.
controls.
hwndwrapper.
HwndWrapperWrapawindowsStaticcontrolcan_be_label=Truefriendlyclassname='Static'windowclasses=['Static','WindowsForms\\d*\\.
STATIC\TPanel','.
*StaticText']11.
4.
6pywinauto.
controls.
uiawrapperBasicwrappingofUIAutomationelementsclasspywinauto.
controls.
uiawrapper.
LazyProperty(fget)Bases:objectAlazyevaluationofanobjectattribute.
Thepropertyshouldrepresentimmutabledata,asitreplacesitself.
Providedby:http://stackoverow.
com/a/6849299/1260742classpywinauto.
controls.
uiawrapper.
UIAWrapper(element_info)Bases:pywinauto.
base_wrapper.
BaseWrapperDefaultwrapperforUserInterfaceAutomation(UIA)controls.
AllotherUIAwrappersarederivedfromthis.
ThisclasswrapsalotoffunctionalityofunderlyingUIAfeaturesforworkingwithwindows.
Mostofthemethodsapplytoeverysingleelementtype.
Forexampleyoucanclick()onanyelement.
automation_id()ReturntheAutomationIDofthecontrolcan_select_multiple()AninterfacetoCanSelectMultipleoftheSelectionProviderpatternIndicateswhethertheUIAutomationproviderallowsmorethanonechildelementtobeselectedconcurrently.
children_texts()Gettextsofthecontrol'schildrenclose()ClosethewindowOnlyacontrolsupportingWindowpatternshouldanswer.
Ifitdoesn't(menushadows,tooltips,.
.
.
),trytosend"Esc"keycollapse()Displaysallchildnodes,controls,orcontentofthecontrolAninterfacetoCollapsemethodoftheExpandCollapsecontrolpattern.
expand()Displaysallchildnodes,controls,orcontentofthecontrolAninterfacetoExpandmethodoftheExpandCollapsecontrolpattern.
108Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8friendly_class_name()ReturnthefriendlyclassnameforthecontrolThisdiffersfromtheclassofthecontrolinsomecases.
class_name()istheactual'Registered'windowclassofthecontrolwhilefriendly_class_name()ishopefullysomethingthatwillmakemoresensetotheuser.
ForexampleCheckboxesareimplementedasButtons-sotheclassofaCheckBoxis"Button"-butthefriendlyclassis"CheckBox"get_expand_state()Indicatesthestateofthecontrol:expandedorcollapsed.
AninterfacetoCurrentExpandCollapseStatepropertyoftheExpandCollapsecontrolpattern.
Valuesforenumerationasdenedinuia_denesmodule:expand_state_collapsed=0ex-pand_state_expanded=1expand_state_partially=2expand_state_leaf_node=3get_selection()AninterfacetoGetSelectionoftheSelectionProviderpatternRetrievesaUIAutomationproviderforeachchildelementthatisselected.
BuildsalistofUIAElementInfoelementsfromallretrievedproviders.
get_show_state()GettheshowstateandMaximized/minimzed/restoredstateReturnsvaluesasfollowingwindow_visual_state_normal=0window_visual_state_maximized=1win-dow_visual_state_minimized=2has_keyboard_focus()ReturnTrueiftheelementisfocusedwithkeyboardiface_expand_collapse=Noneiface_grid=Noneiface_grid_item=Noneiface_invoke=Noneiface_item_container=Noneiface_range_value=Noneiface_scroll=Noneiface_scroll_item=Noneiface_selection=Noneiface_selection_item=Noneiface_table=Noneiface_table_item=Noneiface_text=Noneiface_toggle=Noneiface_transform=Noneiface_transformV2=Noneiface_value=None11.
4.
ControlsReference109pywinautoDocumentation,Release0.
6.
8iface_virtualized_item=Noneiface_window=Noneinvoke()AninterfacetotheInvokemethodoftheInvokecontrolpatternis_active()Whetherthewindowisactiveornotis_collapsed()Testifthecontroliscollapsedis_dialog()Returntrueifthecontrolisadialogwindow(WindowPatterninterfaceisavailable)is_expanded()Testifthecontrolisexpandedis_keyboard_focusable()ReturnTrueiftheelementcanbefocusedwithkeyboardis_maximized()Indicatewhetherthewindowismaximizedornotis_minimized()Indicatewhetherthewindowisminimizedornotis_normal()Indicatewhetherthewindowisnormal(i.
e.
notminimizedandnotmaximized)is_selected()Indicatethattheitemisselectedornot.
OnlyitemssupportingSelectionItempatternshouldanswer.
RaiseNoPatternInterfaceErrorifthepatternisnotsupportedUsuallyappliedforcontrolslike:aradiobutton,atreeviewitem,alistitem.
is_selection_required()AninterfacetoIsSelectionRequiredpropertyoftheSelectionProviderpattern.
Thispropertycanbedynamic.
Forexample,theinitialstateofacontrolmightnothaveanyitemsselectedbydefault,meaningthatIsSelectionRequiredisFALSE.
However,afteranitemisselectedthecontrolmustalwayshaveatleastoneitemselected.
legacy_properties()Gettheelement'sLegacyIAccessiblecontrolpatterninterfacepropertiesmaximize()MaximizethewindowOnlycontrolssupportingWindowpatternshouldanswermenu_select(path,exact=False)SelectamenuitemspeciedinthepathThefullpathsyntaxisspeciedin:pywinauto.
menuwrapper.
Menu.
get_menu_path()Thereareusuallyatleasttwomenubars:"System"and"Application"Systemmenubarisastandardwindowmenuwithitemslike:'Restore','Move','Size','Minimize',e.
t.
c.
Thismenubarusuallyhasa"TitleBar"controlasaparent.
Applicationmenubarisoftenwhatwelookfor.
Inmostcases,itsparentisthedialogitselfsoitshouldbefoundamongthedirectchildrenofthedialog.
Noticethatwedon'tuse"Application"stringasatitlecriteriabecauseitcouldn't110Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8workonapplicationswithanon-englishlocalization.
IfthereisnomenubarhasbeenfoundwefallbacktolookupforMenucontrol.
Wetrytondthecontrolthroughalldescendantsofthedialogminimize()MinimizethewindowOnlycontrolssupportingWindowpatternshouldanswerrestore()RestorethewindowtonormalsizeOnlycontrolssupportingWindowpatternshouldanswerscroll(direction,amount,count=1,retry_interval=0.
1)Askthecontroltoscrollitselfdirectioncanbeanyof"up","down","left","right"amountcanbeonly"line"or"page"count(optional)thenumberoftimestoscrollretry_interval(optional)intervalbetweenscrollactionsselect()SelecttheitemOnlyitemssupportingSelectionItempatternshouldanswer.
RaiseNoPatternInterfaceErrorifthepatternisnotsupportedUsuallyappliedforcontrolslike:aradiobutton,atreeviewitemoralistitem.
selected_item_index()Returntheindexofaselecteditemset_focus()Setthefocustothiselementwritable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
uiawrapper.
UiaMeta(name,bases,attrs)Bases:pywinauto.
base_wrapper.
BaseMetaMetaclassforUiaWrapperobjectsstaticfind_wrapper(element)FindthecorrectwrapperforthisUIAelementpywinauto.
controls.
uiawrapper.
lazy_propertyaliasofLazyProperty11.
4.
7pywinauto.
controls.
uia_controlsWrapvariousUIAwindowscontrolsclasspywinauto.
controls.
uia_controls.
ButtonWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapaUIA-compatibleButton,CheckBoxorRadioButtoncontrolclick()ClicktheButtoncontrolbyusingInvokeorSelectpatterns11.
4.
ControlsReference111pywinautoDocumentation,Release0.
6.
8get_toggle_state()Getatogglestateofacheckboxcontrol.
Thetogglestateisrepresentedbyaninteger0-unchecked1-checked2-indeterminateThefollowingconstantsaredenedintheuia_denesmoduletoggle_state_off=0tog-gle_state_on=1toggle_state_inderteminate=2is_dialog()ButtonsareneverdialogssoreturnFalsetoggle()AninterfacetoTogglemethodoftheTogglecontrolpattern.
ControlsupportingtheTogglepatterncyclesthroughitstogglestatesinthefollowingorder:ToggleState_On,ToggleState_Offand,ifsupported,ToggleState_IndeterminateUsuallyappliedforthecheckboxcontrol.
TheradiobuttoncontroldoesnotimplementIToggleProvider,becauseitisnotcapableofcy-clingthroughitsvalidstates.
Toggleastateofacheckboxcontrol.
(Use'select'methodin-stead)Notice,aradiobuttoncontrolisn'tsupportedbyUIA.
https://msdn.
microsoft.
com/en-us/library/windows/desktop/ee671290(v=vs.
85).
aspxclasspywinauto.
controls.
uia_controls.
ComboBoxWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapaUIACoboBoxcontrolcollapse()expand()get_expand_state()is_editable()item_count()ReturnthenumberofitemsinthecomboboxTheinterfaceiskeptmostlyforabackwardcompatibilitywiththenativeComboBoxinterfaceselect(item)SelecttheComboBoxitemTheitemcanbeeithera0basedindexoftheitemtoselectoritcanbethestringthatyouwanttoselectselected_index()Returntheselectedindexselected_text()ReturntheselectedtextorNoneNotice,thatincaseofmulti-selectitwillbeonlythetextfromarstselecteditemtexts()Returnthetextoftheitemsinthecomboboxclasspywinauto.
controls.
uia_controls.
EditWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleEditcontrolget_line(line_index)Returnthelinespecied112Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8get_value()Returnthecurrentvalueoftheelementhas_title=Falseis_editable()Returntheeditpossibilityoftheelementline_count()ReturnhowmanylinesthereareintheEditline_length(line_index)Returnhowmanycharactersthereareinthelineselect(start=0,end=None)Settheeditselectionoftheeditcontrolselection_indices()Thestartandendindicesofthecurrentselectionset_edit_text(text,pos_start=None,pos_end=None)Setthetextoftheeditcontrolset_text(text,pos_start=None,pos_end=None)Setthetextoftheeditcontrolset_window_text(text,append=False)Overrideset_window_textforeditcontrolsbecauseitshouldnotbeusedforEditcontrols.
EditControlsshouldeitheruseset_edit_text()ortype_keys()tomodifythecontentsoftheeditcontrol.
text_block()Getthetextoftheeditcontroltexts()Getthetextoftheeditcontrolwritable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
uia_controls.
HeaderItemWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleHeaderItemcontrolclasspywinauto.
controls.
uia_controls.
HeaderWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleHeadercontrolclasspywinauto.
controls.
uia_controls.
ListItemWrapper(elem,con-tainer=None)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleListViewItemcontrolis_checked()ReturnTrueiftheListItemischeckedOnlyitemssupportingTogglepatternshouldanswer.
RaiseNoPatternInterfaceErrorifthepat-ternisnotsupportedtexts()Returnalistofitemtexts11.
4.
ControlsReference113pywinautoDocumentation,Release0.
6.
8classpywinauto.
controls.
uia_controls.
ListViewWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleListViewcontrolcell(row,column)ReturnacellintheListViewcontrolOnlyforcontrolswithGridpatternsupportrowisanindexofarowinthelist.
columnisanindexofacolumninthespeciedrow.
Thereturnedcellcanbeofdifferentcontroltypes.
Mostly:TextBlock,ImageControl,EditCon-trol,DataItemorevenanotherlayerofdataitems(Group,DataGrid)cells()Returnlistoflistofcellsforanytypeofcontolcolumn_count()Returnthenumberofcolumnscolumns()GettheinformationonthecolumnsoftheListViewget_column(col_index)GettheinformationforacolumnoftheListViewget_header_control()ReturnHeadercontrolassociatedwiththeListViewget_header_controls()ReturnHeadercontrolsassociatedwiththeTableget_item(row)ReturnanitemoftheListViewcontrolrowcanbeeitheranindexoftheroworastringwiththetextofacellintherowyouwantreturned.
get_item_rect(item_index)ReturntheboundingrectangleofthelistviewitemThemethodiskeptmostlyforabackwardcompatibilitywiththenativeListViewWrapperin-terfaceget_items()ReturnallitemsoftheListViewcontrolget_selected_count()ReturnanumberofselecteditemsThecallcanbequiteexpensieveasweretrievealltheselecteditemsinordertocountthemitem(row)ReturnanitemoftheListViewcontrolrowcanbeeitheranindexoftheroworastringwiththetextofacellintherowyouwantreturned.
item_count()AnumberofitemsintheListViewitems()ReturnallitemsoftheListViewcontrol114Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8texts()Returnalistofitemtextswritable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
uia_controls.
MenuItemWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleMenuItemcontrolitems()Findallitemsofthemenuitemselect()ApplySelectpatternclasspywinauto.
controls.
uia_controls.
MenuWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleMenuBarorMenucontrolitem_by_index(idx)Findamenuitemspeciedbytheindexitem_by_path(path,exact=False)FindamenuitemspeciedbythepathThefullpathsyntaxisspeciedin:controls.
menuwrapper.
Menu.
get_menu_path()Note:$-specierisnotsupporteditems()Findallmenuitemsclasspywinauto.
controls.
uia_controls.
SliderWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleSlidercontrolhas_title=Falselarge_change()Getalargechangeofslider'sthumbThischangeisachievedbypressingPgUpandPgDownkeyswhenslider'sthumbhaskeyboardfocus.
max_value()GetthemaximumvalueoftheSlidermin_value()GettheminimumvalueoftheSliderset_value(value)Setpositionofslider'sthumbsmall_change()Getasmallchangeofslider'sthumbThischangeisachievedbypressingleftandrightarrowswhenslider'sthumbhaskeyboardfocus.
value()Getacurrentpositionofslider'sthumb11.
4.
ControlsReference115pywinautoDocumentation,Release0.
6.
8classpywinauto.
controls.
uia_controls.
StaticWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleTextcontrolcan_be_label=Trueclasspywinauto.
controls.
uia_controls.
TabControlWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleTabcontrolget_selected_tab()Returnanindexofaselectedtabselect(item)Selectatabbyindexorbynametab_count()Returnanumberoftabstexts()Tabstextsclasspywinauto.
controls.
uia_controls.
ToolbarWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleToolBarcontrolThecontrol'schildrenusuallyare:Buttons,SplitButton,MenuItems,ThumbControls,TextControls,Separators,CheckBoxes.
NoticethatToolTipcontrolsarechildrenofthetopwindowandnotofthetoolbar.
button(button_identier,exact=True)Returnabuttonbythespeciedidentierbutton_identiercanbeeitheranindexofabuttonorastringwiththetextofthebutton.
exactagspeciesiftheexactmatchforthetextlookuphastobeapplied.
button_count()ReturnanumberofbuttonsontheToolBarbuttons()Returnallavailablebuttonscheck_button(button_identier,make_checked,exact=True)Findwherethebuttonisandtoggleitbutton_identiercanbeeitheranindexofthebuttonorastringwiththetextonthebutton.
make_checkedspeciestherequiredtoggledstateofthebutton.
Ifthebuttonisalreadyinthespeciedstatethestateisn'tchanged.
exactagspeciesiftheexactmatchforthetextlookuphastobeappliedtexts()ReturntextsoftheToolbarwritable_propsExtenddefaultpropertieslist.
classpywinauto.
controls.
uia_controls.
TooltipWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleTooltipcontrolclasspywinauto.
controls.
uia_controls.
TreeItemWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapper116Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8WrapanUIA-compatibleTreeItemcontrolInadditiontotheprovidedmethodsofthewrapperadditionalinheritedmethodscanbeespeciallyhelpful:select(),extend(),collapse(),is_extended(),is_collapsed(),click_input(),rectangle()andmanyothersensure_visible()MakesurethattheTreeViewitemisvisibleget_child(child_spec,exact=False)ReturnthechilditemofthisitemAcceptseitherastringoranindex.
Ifastringispassedthenitreturnsthechilditemwiththebestmatchforthestring.
is_checked()ReturnTrueiftheTreeItemischeckedOnlyitemssupportingTogglepatternshouldanswer.
RaiseNoPatternInterfaceErrorifthepat-ternisnotsupportedsub_elements()Returnalistofallvisiblesub-itemsofthiscontrolclasspywinauto.
controls.
uia_controls.
TreeViewWrapper(elem)Bases:pywinauto.
controls.
uiawrapper.
UIAWrapperWrapanUIA-compatibleTreecontrolget_item(path,exact=False)ReadaTreeViewitempathapathtotheitemtoreturn.
Thiscanbeoneofthefollowing:–Astringseparatedby\characters.
Therstcharactermustbe\.
Thisstringissplitonthe\charactersandeachoftheseisusedtondthespecicchildateachlevel.
The\representstherootitem-soyoudon'tneedtospecifytherootitself.
–Alist/tupleofstrings-Therstitemshouldbetherootelement.
–Alist/tupleofintegers-Therstitemtheindexwhichroottoselect.
Indexingalwaysstartsfromzero:get_item((0,2,3))exactaagtorequestexactmatchofstringsinthepathorapplyafuzzylogicofbest_matchthusallowingnon-exactpathspeciersitem_count()ReturnanumberofitemsinTreeViewprint_items()Printallitemswithlineindentsroots()ReturnrootelementsofTreeViewwritable_propsExtenddefaultpropertieslist.
11.
5Pre-suppliedTests11.
5.
1pywinauto.
tests.
allcontrolsGetAllControlsTest11.
5.
Pre-suppliedTests117pywinautoDocumentation,Release0.
6.
8WhatischeckedThistestdoesnoactualtestingitjustreturnseachcontrol.
HowisitcheckedAloopoverallthecontrolsinthedialogismadeandeachcontroladdedtothelistofbugsWhenisabugreportedForeachcontrol.
BugExtraInformationThereisnoextrainformationassociatedwiththisbugtypeIsReferencedialogneededNo,butifavailablethereferencecontrolwillbereturnedwiththelocalisedcontrol.
FalsepositivebugreportsNotpossibleTestIdentierTheidentierforthistest/bugis"AllControls"pywinauto.
tests.
allcontrols.
AllControlsTest(windows)Returnsjustonebugforeachcontrol11.
5.
2pywinauto.
tests.
asianhotkeyAsianHotkeyFormatTestWhatischeckedThistestcheckswhethertheformatforshortcuts/hotkeysfollowsthestandardsforlocalisedWindowsapplications.
Thisformatis{localisedtext}({uppercasehotkey})soforexampleiftheEnglishcontrolis"&Help"thelocalisedcontrolforAsianlanguagesshouldbe"LocHelp(H)"HowisitcheckedAftercheckingwhetherthiscontroldisplayshotkeysitexaminesthe1ststringofthecontroltomakesurethattheformatiscorrect.
Ifthereferencecontrolisavailablethenitalsomakessurethatthehotkeycharacteristhesameasthereference.
Controlswithatitleoflessthan4charactersareignored.
Thishasbeendonetoavoidfalsepositivebugreportsforstringslike"&X:".
WhenisabugreportedAbugisreportedwhenacontrolhasahotkeyanditisnotinthecorrectformat.
AlsoifthereferencecontrolisavailableabugwillbereportedifthehotkeycharacterisnotthesameasusedinthereferenceBugExtraInformationThistestproduces2differenttypesofbug:BugType:"AsianHotkeyFormat"ThereisnoextrainformationassociatedwiththisbugtypeBugType:"AsianHotkeyDiffRef"ThereisnoextrainformationassociatedwiththisbugtypeIsReferencedialogneededThereferencedialogisnotneeded.
Ifitisunavailablethenonlybugsoftype"AsianHotkeyFormat"willbereported,bugoftype"AsianHotkeyDiffRef"willnotbefound.
FalsepositivebugreportsThereshouldbeveryfewfalsepositivebugreportswhentestingAsiansoftware.
Ifastringisveryshort(eg"&Y:")butispaddedwithspacesthenitwillgetreported.
TestIdentierTheidentierforthistest/bugis"AsianHotkeyTests"118Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8pywinauto.
tests.
asianhotkey.
AsianHotkeyTest(windows)Returntherepeatedhotkeyerrors11.
5.
3pywinauto.
tests.
comboboxdroppedheightComboBoxdroppedheightTestWhatischeckedItisensuredthattheheightofthelistdisplayedwhenthecomboboxisdroppeddownisnotlessthantheheightofthereference.
HowisitcheckedThevalueforthedroppedrectanglecanberetrievedfromwindows.
Theheightofthisrectangleiscalculatedandcomparedagainstthereferenceheight.
WhenisabugreportedIftheheightofthedroppedrectangleforthecomboboxbeingcheckedislessthantheheightofthereferenceonethenabugisreported.
BugExtraInformationThereisnoextrainformationassociatedwiththisbugtypeIsReferencedialogneededThereferencedialogisnecessaryforthistest.
FalsepositivebugreportsNofalsebugsshouldbereported.
Ifthefontofthelocalisedcontrolhasasmallerheightthanthereferencethenitispossiblethatthedroppedrectanglecouldbeofadifferentsize.
TestIdentierTheidentierforthistest/bugis"ComboBoxDroppedHeight"pywinauto.
tests.
comboboxdroppedheight.
ComboBoxDroppedHeightTest(windows)Checkifeachcomboboxheightisthesameasthereference11.
5.
4pywinauto.
tests.
comparetoreffontCompareagainstreferencefonttestWhatischeckedThistestchecksalltheparametersofthefontforthecontrolagainstthefontforthereferencecontrol.
Ifanyvalueisdifferentthenthisisreportedasabug.
Hereisalistofallthepossiblevaluesthataretested:lfFaceNameThenameofthefontlfHeightTheheightofthefontlfWidthAveragewidthofcharacterslfEscapementAngleoftextlfOrientationAnotherangleforthetext!
lfWeightHowboldthetextislfItalicIfthefontisitaliclfUnderlineIfthefontisunderlinedlfStrikeOutIfthefontisstruckoutlfCharSetThecharactersetofthefontlfOutPrecisionTheoutputprecisionlfClipPrecisionTheclippingprecisionlfQualityTheoutputqualitylfPitchAndFamilyThepitchandfamilyHowisitcheckedEachpropertyofthefontforthecontrolbeingtestediscomparedagainsttheequivalentpropertyofthereferencecontrolfontforequality.
WhenisabugreportedForeachpropertyofthefontthatisnotidenticaltothereferencefontabugisreported.
SoforexampleiftheFontFacehaschangedandthetextisboldthen(atleast)2bugswillbereported.
BugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionValueTypeWhatvalueisincorrect(seeabove),StringRefThereferencevalueconvertedtoastring,StringLocThelocalisedvalueconvertedtoastring,StringIsReferencedialogneededThistestwillnotrunifthereferencecontrolsarenotavailable.
FalsepositivebugreportsRunningthistestforAsianlanguageswillresultinLOTSandLOTSoffalsepositives,becausethefontHAStochangeforthelocalisedtexttodisplayproperly.
TestIdentierTheidentierforthistest/bugis"CompareToRefFont"pywinauto.
tests.
comparetoreffont.
CompareToRefFontTest(windows)Comparethefonttothefontofthereferencecontrol11.
5.
Pre-suppliedTests119pywinautoDocumentation,Release0.
6.
811.
5.
5pywinauto.
tests.
leadtrailspacesDifferentLeadingandTrailingSpacesTestWhatischeckedChecksthatthesamespacecharacters(,,,)arebeforeandafterallnonspacecharactersinthetitleofthecontrolwhencomparedtothereferencecontrol.
HowisitcheckedFindthe1stnon-spacecharacter,andthecharactersofthetitleuptothataretheleadingspaces.
Findthelastnon-spacecharacter,andthecharactersofthetitleafterthatarethetrailingspaces.
Thesearethencomparedtotheleadandtrailspacesfromthereferencecontrolandiftheyarenotexactlythethenabugisreported.
WhenisabugreportedWheneithertheleadingortrailingspacesofthecontrolbeingtesteddoesnotmatchtheequivalentspacesofthereferencecontrolexactly.
BugExtraInformationThebugcontainsthefollowingextrainformationLead-TrailWhetherthisbugreportisfortheleadingortrailingspacesofthecontrol,StringThiswillbeeither:–"Leading"bugrelatingtoleadingspaces–"Trailing"bugrelatingtotrailingspacesRefTheleadingortrailingsspacesofthereferencestring(dependingonLead-Trailvalue),StringLocTheleadingortrailingsspacesofthelocalstring(dependingonLead-Trailvalue),StringIsReferencedialogneededThistestwillnotrunifthereferencecontrolsarenotavailable.
FalsepositivebugreportsThisisusuallynotaveryimportanttest,soifitgeneratesmanyfalsepositivesthenweshouldconsiderremovingit.
TestIdentierTheidentierforthistest/bugis"LeadTrailSpaces"pywinauto.
tests.
leadtrailspaces.
GetLeadSpaces(title)Returntheleadingspacesofthestringpywinauto.
tests.
leadtrailspaces.
GetTrailSpaces(title)Returnthetrailingspacesofthestringpywinauto.
tests.
leadtrailspaces.
LeadTrailSpacesTest(windows)Returntheleading/trailingspacebugsforthewindows11.
5.
6pywinauto.
tests.
miscvaluesMiscellaneousControlpropertiesTestWhatischeckedThischecksvariousvaluesrelatedtoacontrolinwindows.
Thevaluestestedareclass_nameTheclasstypeofthecontrolstyleTheStyleofthecontrol(GetWindowLong)exstyleTheExtendedStyleofthecontrol(GetWindowLong)help_idTheHelpIDofthecontrol(GetWindowLong)control_idTheControlIDofthecontrol(GetWindowLong)user_dataTheUserDataofthecontrol(GetWindowLong)VisibilityWhetherthecontrolisvisibleornotHowisitcheckedAfterretrievingtheinformationforthecontrolwecompareittothesameinformationfromthereferencecontrol.
WhenisabugreportedIftheinformationdoesnotmatchthenabugisreported.
BugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionValueTypeWhatvalueisincorrect(seeabove),StringRefThereferencevalueconvertedtoastring,StringLocThelocalisedvalueconvertedtoastring,String120Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8IsReferencedialogneededThistestwillnotrunifthereferencecontrolsarenotavailable.
FalsepositivebugreportsSomevaluescanchangeeasilywithoutanybugbeingcaused,forexampleUserDataisactuallymeantforprogrammerstostoreinformationforthecontrolandthiscanchangeeverytimethesoftwareisrun.
TestIdentierTheidentierforthistest/bugis"MiscValues"pywinauto.
tests.
miscvalues.
MiscValuesTest(windows)Returnthebugsfromcheckingmiscelaneousvaluesofacontrol11.
5.
7pywinauto.
tests.
missalignmentMissalignmentTestWhatischeckedThistestchecksthatifasetofcontrolswerealignedonaparticularaxisinthereferencedialogthattheyareallalignedonthesameaxis.
HowisitcheckedAlistofallthereferencecontrolsthatarealignediscreated(iemorethanonecontrolwiththesameTop,Left,BottomorRightcoordinates).
Thesecontrolsarethenanalysedinthelocaliseddialogtomakesurethattheyareallalignedonthesameaxis.
WhenisabugreportedAbugisreportedwhenanyofthecontrolsthatwerealignedinthereferencedialogarenolongeralignedinthelocalisedcontrol.
BugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionAlignment-TypeThisiseitherLEFT,TOP,RIGHTorBOTTOM.
Ittellsyouhowthecontrolswerealignedinthereferencedialog.
StringAlignmentRectGivesthesmallestrectanglethatsurroundsALLthecontrolsconcernedinthebug,rectangleIsReferencedialogneededThistestcannotbeperformedwithoutthereferencecontrol.
Itisrequiredtoseewhichcontrolsshouldbealigned.
FalsepositivebugreportsItisquitepossiblethatthistestreportsfalsepositives:1.
Wherethecontrolsonlyjusthappentobealignedinthereferencedialog(bycoincidence)2.
Wherethecontroldoesnothaveaclearboundary(forexamplestaticlabelsorcheckboxes)theymaybemiss-alignedbutitisnotnoticeablethattheyarenot.
TestIdentierTheidentierforthistest/bugis"Missalignment"pywinauto.
tests.
missalignment.
MissalignmentTest(windows)Runthetestonthewindowspassedin11.
5.
8pywinauto.
tests.
missingextrastringDifferentnumberofspecialcharactersequencesTestWhatischeckedThistestcheckstomakesurethatcertainspecialcharactersequencesappeartheinthelocalisediftheyappearinthereferencetitlestrings.
Thesestringsusuallymeansomethingtotheuserbutthesoftwareinternallydoesnotcareiftheyexistornot.
Thelistthatiscurrentlycheckedis:colon)HowisitcheckedForeachofthestringtocheckforwemakesurethatifitappearsinthereferencethatitalsoappearsinthelocalisedtitle.
WhenisabugreportedIfthereferencehasoneofthetextstringsbutthelocaliseddoesnotabugisreported.
Ifthelocalisedhasoneofthetextstringsbutthereferencedoesnotabugisreported.
11.
5.
Pre-suppliedTests121pywinautoDocumentation,Release0.
6.
8BugExtraInformationThebugcontainsthefollowingextrainformationMissingOrExtraWhetherthecharactersaremissingorextrafromthecontrolsbeingcheckascomparedtothereference,(Stringwithfollowingpossiblevalues)"MissingCharacters"Thecharactersareinthereferencebutnotinthelocalised.
"ExtraCharacters"Thecharactersarenotinthereferencebutareinthelocalised.
MissingOrExtraTextWhatcharacterstringismissingoradded,StringIsReferencedialogneededThistestwillnotrunifthereferencecontrolsarenotavailable.
FalsepositivebugreportsCurrentlythistestisatabetastagelteringoftheresultsisprobablynecessaryatthemoment.
TestIdentierTheidentierforthistest/bugis"MissingExtraString"pywinauto.
tests.
missingextrastring.
MissingExtraStringTest(windows)Returntheerrorsfromrunningthetest11.
5.
9pywinauto.
tests.
overlappingOverlappingTestWhatischeckedTheoverlappingtestchecksforcontrolsthatoccupythesamespaceassomeothercontrolinthedialog.
Ifthereferencecontrolsareavailablecheckforeachpairofcontrols:–Ifcontrolsareexactlythesamesizeandpositioninreferencethenmakesurethattheyarealsointhelocalised.
–Ifareferencecontroliswhollycontainedinanothermakesurethatthesamehappensforthecontrolsbeingtested.
Ifthereferencecontrolsarenotavailableonlythefollowingcheckcanbedone–Ifcontrolsareoverlappedinlocalisedreportabug(ifreferenceisavailableitisusedjusttosayifthisoverlappinghappensinreferencealso)HowisitcheckedVarioustestsareperformedoneachpairofcontrolstoseeifanyoftheaboveconditionsaremet.
Themostspecicteststhatcanbeperformedaredone1stsothatthebugsreportedareasspecicaspossible.
I.
e.
wereportthat2controlsarenotexactlyoverlappedwhentheyshouldberatherthanjutreportingthattheyareoverlappedwhichcontainslessinformation.
WhenisabugreportedAbugisreportedwhen:controlsareoverlapped(butnotcontainedwholly,andnotexactlyoverlapped)referencecontrolsareexactlyoverlappedbuttheyarenotintesteddialogonereferencecontroliswhollycontainedinanotherbutnotintesteddialogBugExtraInformationThistestproduces3differenttypesofbug:BugType:"Overlapping"NameDescriptionOverlappedRect,rectangleBugType-"NotContainedOverlap"ThereisnoextrainformationassociatedwiththisbugtypeBugType-"NotExactOverlap"ThereisnoextrainformationassociatedwiththisbugtypeIsReferencedialogneededForcheckingwhethercontrolsshouldbeexactlyoverlappedandwhethertheyshouldbewhollycontainedthereferencecontrolsarenecessary.
Ifthereferencecontrolsarenotavailablethenonlysimpleoverlappingofcontrolswillbechecked.
122Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8FalsepositivebugreportsIftherearecontrolsinthedialogthatarenotvisibleoraremoveddynamicallyitmaycausebugstobereportedthatdonotneedtobelogged.
Ifnecessarylteroutbugswithhiddencontrols.
TestIdentierTheidentierforthistestis"Overlapping"classpywinauto.
tests.
overlapping.
OptRectpywinauto.
tests.
overlapping.
OverlappingTest(windows)Returntherepeatedhotkeyerrors11.
5.
10pywinauto.
tests.
repeatedhotkeyRepeatedHotkeysTestWhatischeckedThistestchecksallthecontrolsinadialogtoseeiftherearecontrolsthatusethesamehotkeycharacter.
HowisitcheckedAlistofallthehotkeys(convertedtouppercase)usedinthedialogiscreated.
Thenthislistisexaminedtoseeifanyhotkeysareusedmorethanonce.
Ifanyareusedmorethanoncealistofallthecontrolsthatusethishotkeyarecompiledtobeusedinthebugreport.
WhenisabugreportedIfmorethanonecontrolhasthesamehotkeythenabugisreported.
BugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionRepeated-HotkeyThisisthehotkeythatisrepeatedbetweenthe2controlsconvertedtouppercase,StringChar-sUsedInDialogThisisalistofallthehotkeysusedinthedialog,StringAllCharsInDialogThisisalistofallthecharactersinthedialogforcontrolsthathaveahotkeys,StringAvailableInControlSAlistoftheavailablecharactersforeachcontrol.
Anyofthecharactersinthislistcouldbeusedasthenewhotkeywithoutconictingwithanyexistinghotkey.
IsReferencedialogneededThereferencedialogdoesnotneedtobeavailable.
Ifitisavailablethenforeachbugdiscovereditischeckedtoseeifitisaprobleminthereferencedialog.
NOTE:Checkingthereferencedialogisnotsoexacthere!
Onlywhentheequivalentcontrolsinthereferencedialogallhavethehotkeyswillitbereportedasbeinginthereferencealso.
I.
e.
ifthereare3controlswiththesamehotkeyintheLocalisedsoftwarethenthosesamecontrolsinthereferencedialogmusthavethesamehotkeyforittobereportedasexistinginthereferencealso.
FalsepositivebugreportsThereshouldbeveryfewfalsepositivesfromthistest.
Sometimesacontrolonlyhasoneor2characterseg"X:"anditisimpossibletoavoidahotkeyclash.
AlsoforAsianlanguageshotkeysshouldbethesameastheUSsoftwaresoprobablythistestshouldberunonthoselanguages.
TestIdentierTheidentierforthistest/bugis"RepeatedHotkey"pywinauto.
tests.
repeatedhotkey.
GetHotkey(text)Returnthepositionandcharacterofthehotkeypywinauto.
tests.
repeatedhotkey.
ImplementsHotkey(win)checkswhetheracontrolinterprets&charactertobeahotkeypywinauto.
tests.
repeatedhotkey.
RepeatedHotkeyTest(windows)Returntherepeatedhotkeyerrors11.
5.
11pywinauto.
tests.
translationTranslationTestWhatischeckedThischecksforcontrolswhichappearnottobetranslated.
HowisitcheckedItcomparesthetextofthelocalisedandreferencecontrols.
11.
5.
Pre-suppliedTests123pywinautoDocumentation,Release0.
6.
8IftherearemorethanstringinthecontroltheneachitemissearchedforintheUSlistoftitles(socheckingisnotorderdependent).
Theindicesfortheuntranslatedstringsarereturnedinacommaseparatedstring.
Alsotheuntranslatedstringsthemselvesarereturned(allasonestring).
Thesestringsarenotescapedandaredelimitedas"string1","string2",.
.
.
"stringN".
WhenisabugreportedIfthetextofthelocalisedcontrolisidenticaltothereferencecontrol(incase,spacingi.
e.
abinarycompare)thenitwillbeaggedasuntranslated.
Otherwisethecontrolistreatedastranslated.
Note:Thisisthemethodtoreturntheleastnumberofbugs.
Iftherearedifferencesinanypartofthestring(e.
g.
apathorvariablename)buttherestofthestringisuntranslatedthenabugwillnotbehighlightedBugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionStringsThelistoftheuntranslatedstringsasexplainedaboveStringIndicesThelistofindices(0based)thatareuntranslated.
Thiswillusuallybe0butiftherearemanystringsinthecontroluntranslateditwillreportALLthestringse.
g.
0,2,5,19,23IsReferencedialogneededThereferencedialogisalwaysnecessary.
FalsepositivebugreportsFalsepositivebugswillbereportedinthefollowingcases.
-ThetitleofthecontrolstaysthesameastheUSbecausethetranslationisthesameastheEnglishtext(e.
g.
Name:inGerman)-Thetitleofthecontrolisnotdisplayed(andnottranslated).
Thiscansometimeshappeniftheprogrammerdisplayssomethingelseonthecontrolafterthedialogiscreated.
TestIdentierTheidentierforthistest/bugis"Translation"pywinauto.
tests.
translation.
TranslationTest(windows)Returnsjustonebugforeachcontrol11.
5.
12pywinauto.
tests.
truncationTruncationTestWhatischeckedChecksforcontrolswherethetextdoesnottinthespaceprovidedbythecontrol.
HowisitcheckedThereisafunctioninwindows(DrawText)thatallowsustondthesizethatcertaintextwillneed.
Weusethisfunctionwithcorrectfontsandotherrelevantinformationforthecontroltobeasaccurateaspossible.
WhenisabugreportedWhenthecalculatedrequiredsizeforthetextisgreaterthanthesizeofthespaceavailablefordisplayingthetext.
BugExtraInformationThebugcontainsthefollowingextrainformationNameDescriptionStringsThelistofthetruncatedstringsasexplainedaboveStringIndicesThelistofindices(0based)thataretruncated.
Thiswilloftenjustbe0butiftherearemanystringsinthecontroluntranslateditwillreportALLthestringse.
g.
0,2,5,19,23IsReferencedialogneededThereferencedialogdoesnotneedtobeavailable.
Ifitisavailablethenforeachbugdiscovereditischeckedtoseeifitisaprobleminthereferencedialog.
FalsepositivebugreportsCertaincontrolsdonotdisplaythetextthatisthetitleofthecontrol,ifthisisnothandledinastandardmannerbythesoftwarethenDLGCheckwillreportthatthestringistruncated.
TestIdentierTheidentierforthistest/bugis"Truncation"pywinauto.
tests.
truncation.
TruncationTest(windows)Actuallydothetest124Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
811.
6BackendInternalImplementationmodules11.
6.
1pywinauto.
backendBack-endcomponentsstorage(linkstoplatform-specicthings)classpywinauto.
backend.
BackEnd(name,element_info_class,generic_wrapper_class)Minimalback-enddescription(name&2requiredbaseclasses)classpywinauto.
backend.
BackendsRegistryRegistrypatternclassforthelistofavailableback-endselement_classReturnelement_info.
ElementInfo'ssubclassoftheactivebackendnameNameoftheactivebackendwrapper_classBaseWrapper'ssubclassoftheactivebackendpywinauto.
backend.
activate(name)SetactivebackendbynamePossiblevaluesofnameare"win32","uia"orothernameregisteredbytheregister()function.
pywinauto.
backend.
element_class()Returnelement_info.
ElementInfo'ssubclassoftheactivebackendpywinauto.
backend.
name()Returnnameoftheactivebackendpywinauto.
backend.
register(name,element_info_class,generic_wrapper_class)Registeranewbackendpywinauto.
backend.
wrapper_class()ReturnBaseWrapper'ssubclassoftheactivebackend11.
6.
2pywinauto.
element_infoInterfaceforclasseswhichshoulddealwithdifferentbackendelementsclasspywinauto.
element_info.
ElementInfoAbstractwrapperforanelementchildren(**kwargs)Returnchildrenoftheelementclass_nameReturntheclassnameoftheelementcontrol_idReturntheIDofthecontroldescendants(**kwargs)Returndescendantsoftheelementdump_window()Dumpanelementtoasetofproperties11.
6.
BackendInternalImplementationmodules125pywinautoDocumentation,Release0.
6.
8enabledReturnTrueiftheelementisenabledstaticfilter_with_depth(elements,root,depth)Returnlteredelementswithparticulardepthlevelrelativetotherootframework_idReturntheframeworkoftheelementhandleReturnthehandleoftheelementhas_depth(root,depth)ReturnTrueifelementhasparticulardepthlevelrelativetotherootiter_children(**kwargs)Iterateoverchildrenofelementiter_descendants(**kwargs)IterateoverdescendantsoftheelementnameReturnthenameoftheelementparentReturntheparentoftheelementprocess_idReturntheIDofprocessthatcontrolsthiselementrectangleReturnrectangleofelementrich_textReturnthetextoftheelementset_cache_strategy(cached)SetacachestrategyforfrequentlyusedattributesoftheelementvisibleReturnTrueiftheelementisvisible11.
6.
3pywinauto.
win32_element_infoImplementationoftheclasstodealwithanativeelement(windowwithahandle)classpywinauto.
win32_element_info.
HwndElementInfo(handle=None)Wrapperforwindowhandlerautomation_idReturnAutomationIdoftheelementchildren(**kwargs)Returnalistofimmediatechildrenofthewindowclass_nameReturntheclassnameofthewindowcontrol_idReturntheIDofthewindowcontrol_typeReturncontroltypeoftheelement126Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8descendants(**kwargs)Returndescendantsofthewindow(allchildrenfromsub-tree)dump_window()DumpawindowasasetofpropertiesenabledReturnTrueifthewindowisenabledclassmethodfrom_point(x,y)full_control_typeReturnfullstringofcontroltypeoftheelementhandleReturnthehandleofthewindowiter_children(**kwargs)ReturnageneratorofimmediatechildrenofthewindownameReturnthetextofthewindowparentReturntheparentofthewindowprocess_idReturntheIDofprocessthatcontrolsthiswindowrectangleReturnrectangleoftheelementrich_textReturnthetextofthewindowset_cache_strategy(cached)Setacachestrategyforfrequentlyusedattributesoftheelementclassmethodtop_from_point(x,y)visibleReturnTrueifthewindowisvisiblewm_get_ctrl_name=-1wm_get_ctrl_type=-111.
6.
4pywinauto.
uia_element_infoImplementationoftheclasstodealwithanUIelement(basedonUIAutomationAPI)classpywinauto.
uia_element_info.
UIAElementInfo(handle_or_elem=None,cache_enable=False)UIelementwrapperforIUIAutomationAPIautomation_idReturnAutomationIdoftheelementchildren(**kwargs)Returnalistofonlyimmediatechildrenoftheelementkwargsisacriteriatoreducealistbyprocess,class_name,control_type,content_onlyand/ortitle.
11.
6.
BackendInternalImplementationmodules127pywinautoDocumentation,Release0.
6.
8class_nameReturnclassnameoftheelementcontrol_idReturnControlIdoftheelementifithasahandlecontrol_typeReturncontroltypeofelementdescendants(**kwargs)Returnalistofalldescendantchildrenoftheelementkwargsisacriteriatoreducealistbyprocess,class_name,control_type,content_onlyand/ortitle.
dump_window()DumpwindowtoasetofpropertieselementReturnAutomationElement'sinstanceenabledCheckiftheelementisenabledframework_idReturnFrameworkIdoftheelementclassmethodfrom_point(x,y)handleReturnhandleoftheelementiter_children(**kwargs)Returnageneratorofonlyimmediatechildrenoftheelementkwargsisacriteriatoreducealistbyprocess,class_name,control_type,content_onlyand/ortitle.
nameReturnnameoftheelementparentReturnparentoftheelementprocess_idReturnProcessIdoftheelementrectangleReturnrectangleoftheelementrich_textReturnrich_textoftheelementruntime_idReturnRuntimeID(hashablevaluebutmaybedifferentfromruntorun)set_cache_strategy(cached=None)Setupacachestrategyforfrequentlyusedattributesclassmethodtop_from_point(x,y)visibleCheckiftheelementisvisible128Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8pywinauto.
uia_element_info.
elements_from_uia_array(ptrs,cache_enable=False)BuildalistofUIAElementInfoelementsfromIUIAutomationElementArray11.
6.
5pywinauto.
uia_denesCommonUIAdenitionsandhelperfunctionsclasspywinauto.
uia_defines.
IUIASingletonclasstostoreglobalCOMobjectsfromUIAutomationCore.
dllbuild_condition(process=None,class_name=None,title=None,control_type=None,content_only=None)BuildUIAlteringconditionsexceptionpywinauto.
uia_defines.
NoPatternInterfaceErrorThereisnosuchinterfaceforthespeciedpatternpywinauto.
uia_defines.
get_elem_interface(element_info,pattern_name)AhelpertoretrieveanelementinterfacebythespeciedpatternnameTODO:handleawrongpatternname11.
7InternalModules11.
7.
1pywinauto.
controlpropertiesWrapclasspywinauto.
controlproperties.
ControlProps(*args,**kwargs)WrapcontrolsreadfromaletoresemblehwndcontrolsHasExStyle(*args,**kwargs)HasStyle(*args,**kwargs)WindowText(*args,**kwargs)has_exstyle(exstyle)has_style(style)window_text()classpywinauto.
controlproperties.
FuncWrapper(value)Littleclasstoallowattributeaccesstoreturnacallableobjectpywinauto.
controlproperties.
GetMenuBlocks(ctrls)pywinauto.
controlproperties.
MenuBlockAsControls(menuItems,parent-age=None)pywinauto.
controlproperties.
MenuItemAsControl(menuItem)Makeamenuitemlooklikeacontrolfortestspywinauto.
controlproperties.
SetReferenceControls(controls,refControls)SetthereferencecontrolsforthecontrolspassedinThisdoessomeminorcheckingasfollowing:11.
7.
InternalModules129pywinautoDocumentation,Release0.
6.
8testthattherearethesamenumberofreferencecontrolsascontrols-failswithanexceptioniftherearenottestifalltheID'sarethesameornot11.
7.
2pywinauto.
handlepropsFunctionstoretrievepropertiesfromawindowhandleTheseareimplementedinaproceduralwaysoastotobeusefultoothermoduleswiththeleastconceptualoverheadpywinauto.
handleprops.
children(handle)Returnalistofhandlestothechildrenofthiswindowpywinauto.
handleprops.
classname(handle)Returntheclassnameofthewindowpywinauto.
handleprops.
clientrect(handle)Returntheclientrectangleofthecontrolpywinauto.
handleprops.
contexthelpid(handle)Returnthecontexthelpidofthewindowpywinauto.
handleprops.
controlid(handle)ReturntheIDofthecontrolpywinauto.
handleprops.
dumpwindow(handle)Dumpawindowtoasetofpropertiespywinauto.
handleprops.
exstyle(handle)Returntheextendedstyleofthewindowpywinauto.
handleprops.
font(handle)ReturnthefontasaLOGFONTWofthewindowpywinauto.
handleprops.
has_enough_privileges(process_id)CheckiftargetprocesshasenoughrightstoqueryGUIactionspywinauto.
handleprops.
has_exstyle(handle,tocheck)ReturnTrueifthecontrolhasextendedstyletocheckpywinauto.
handleprops.
has_style(handle,tocheck)ReturnTrueifthecontrolhasstyletocheckpywinauto.
handleprops.
is64bitbinary(lename)Checkiftheleis64-bitbinarypywinauto.
handleprops.
is64bitprocess(process_id)ReturnTrueifthespeciedprocessisa64-bitprocessonx64ReturnFalseifitisonlya32-bitprocessrunningunderWow64.
AlwaysreturnFalseforx86.
pywinauto.
handleprops.
is_toplevel_window(handle)Returnwhetherthewindowisatoplevelwindowornotpywinauto.
handleprops.
isenabled(handle)ReturnTrueifthewindowisenabledpywinauto.
handleprops.
isunicode(handle)ReturnTrueifthewindowisaUnicodewindow130Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8pywinauto.
handleprops.
isvisible(handle)ReturnTrueifthewindowisvisiblepywinauto.
handleprops.
iswindow(handle)ReturnTrueifthehandleisawindowpywinauto.
handleprops.
parent(handle)Returnthehandleoftheparentofthewindowpywinauto.
handleprops.
processid(handle)ReturntheIDofprocessthatcontrolsthiswindowpywinauto.
handleprops.
rectangle(handle)Returntherectangleofthewindowpywinauto.
handleprops.
style(handle)Returnthestyleofthewindowpywinauto.
handleprops.
text(handle)Returnthetextofthewindowpywinauto.
handleprops.
userdata(handle)Returnthevalueofanyuserdataassociatedwiththewindow11.
7.
3pywinauto.
xml_helpersModulecontainingoperationsforreadingandwritingdialogsasXMLpywinauto.
xml_helpers.
ReadPropertiesFromFile(lename)ReturnalistofcontrolsfromXMLlelenamepywinauto.
xml_helpers.
WriteDialogToFile(lename,props)Writethepropstothelepropscanbeeitheradialogoradictionaryexceptionpywinauto.
xml_helpers.
XMLParsingErrorWrapparsingExceptions11.
7.
4pywinauto.
fuzzydictMatchitemsinadictionaryusingfuzzymatchingImplementedforpywinauto.
Thisclassusesdifibtomatchstrings.
ThisclassusesalinearsearchtondtheitemsasitHAStoiterateovereveryiteminthedictionary(otherwiseitwouldnotbepossibletoknowwhichisthe'best'match).
Iftheexactitemisinthedictionary(nofuzzymatchingneeded-thenitdoesn'tdothelinearsearchandspeedshouldbesimilartostandardPythondictionaries.
>>>fuzzywuzzy=FuzzyDict({"hello":"World","Hiya":2,"Hereyouare":3})>>>fuzzywuzzy['Meagain']=[1,2,3]>>>>>>fuzzywuzzy['Hi']2>>>>>>>>>#nextonedoesn'tmatchwellenough-soakeyerrorisraised.
.
.
11.
7.
InternalModules131pywinautoDocumentation,Release0.
6.
8>>>fuzzywuzzy['There']Traceback(mostrecentcalllast):File"",line1,inFile"pywinautouzzydict.
py",line125,in__getitem__raiseKeyError(KeyError:"'There'.
closestmatch:'hello'withratio0.
400">>>>>>fuzzywuzzy['youare']3>>>fuzzywuzzy['again'][1,2,3]>>>classpywinauto.
fuzzydict.
FuzzyDict(items=None,cutoff=0.
6)Providesadictionarythatperformsfuzzylookup11.
7.
5pywinauto.
actionloggerpywinauto.
actionlogger.
ActionLoggeraliasof_StandardLoggerpywinauto.
actionlogger.
disable()Disablepywinautologgingactionspywinauto.
actionlogger.
enable()Enablepywinautologgingactionspywinauto.
actionlogger.
reset_level()Resetaloggingleveltoadefaultpywinauto.
actionlogger.
set_level(level)Setalogginglevelforthepywinautologger.
11.
7.
6pywinauto.
sysinfoSimplemoduleforcheckingwhetherPythonandWindowsare32-bitor64-bitpywinauto.
sysinfo.
is_x64_OS()pywinauto.
sysinfo.
is_x64_Python()pywinauto.
sysinfo.
os_arch()pywinauto.
sysinfo.
python_bitness()11.
7.
7pywinauto.
remote_memory_blockModulecontainingwrapperaroundVirtualAllocEx/VirtualFreeExWin32APIfunctionstoperformcus-tommarshallingexceptionpywinauto.
remote_memory_block.
AccessDeniedRaisedwhenwecannotallocatememoryinthecontrol'sprocessclasspywinauto.
remote_memory_block.
RemoteMemoryBlock(ctrl,size=4096)Classthatenablesreadingandwritingmemoryinadifferentprocess132Chapter11.
SourcecodereferencepywinautoDocumentation,Release0.
6.
8Address()ReturntheaddressofthememoryblockCheckGuardSignature()readguardsignatureattheendofmemoryblockCleanUp()FreeMemoryandtheprocesshandleRead(data,address=None,size=None)ReaddatafromthememoryblockWrite(data,address=None,size=None)Writedataintothememoryblock11.
7.
InternalModules133pywinautoDocumentation,Release0.
6.
8134Chapter11.
SourcecodereferenceCHAPTER12Indicesandtablesgenindexmodindexsearch135pywinautoDocumentation,Release0.
6.
8136Chapter12.
IndicesandtablesPythonModuleIndexppywinauto.
actionlogger,132pywinauto.
application,65pywinauto.
backend,125pywinauto.
base_wrapper,76pywinauto.
clipboard,75pywinauto.
controlproperties,129pywinauto.
controls.
common_controls,89pywinauto.
controls.
hwndwrapper,80pywinauto.
controls.
menuwrapper,87pywinauto.
controls.
uia_controls,111pywinauto.
controls.
uiawrapper,108pywinauto.
controls.
win32_controls,103pywinauto.
element_info,125pywinauto.
findbestmatch,69pywinauto.
findwindows,70pywinauto.
fuzzydict,131pywinauto.
handleprops,130pywinauto.
keyboard,63pywinauto.
mouse,63pywinauto.
remote_memory_block,132pywinauto.
sysinfo,132pywinauto.
tests.
allcontrols,117pywinauto.
tests.
asianhotkey,118pywinauto.
tests.
comboboxdroppedheight,119pywinauto.
tests.
comparetoreffont,119pywinauto.
tests.
leadtrailspaces,120pywinauto.
tests.
miscvalues,120pywinauto.
tests.
missalignment,121pywinauto.
tests.
missingextrastring,121pywinauto.
tests.
overlapping,122pywinauto.
tests.
repeatedhotkey,123pywinauto.
tests.
translation,123pywinauto.
tests.
truncation,124pywinauto.
timings,72pywinauto.
uia_defines,129pywinauto.
uia_element_info,127pywinauto.
win32_element_info,126pywinauto.
win32_hooks,75pywinauto.
xml_helpers,131137pywinautoDocumentation,Release0.
6.
8138PythonModuleIndexIndexSymbols__getattribute__()(pywinauto.
application.
Applicationmethod),65__getattribute__()(pywin-auto.
application.
WindowSpecicationmethod),67__getitem__()(pywinauto.
application.
Applicationmethod),65__getitem__()(pywinauto.
application.
WindowSpecicationmethod),67_listview_item(classinpywin-auto.
controls.
common_controls),90_toolbar_button(classinpywin-auto.
controls.
common_controls),89_treeview_element(classinpywin-auto.
controls.
common_controls),89AAccessDenied,132ActionLogger(inmodulepywinauto.
actionlogger),132activate()(inmodulepywinauto.
backend),125active()(pywinauto.
application.
Applicationmethod),66Address()(pywinauto.
remote_memory_block.
RemoteMemoryBlockmethod),132AllControlsTest()(inmodulepywin-auto.
tests.
allcontrols),118always_wait_until()(inmodulepywinauto.
timings),74always_wait_until_passes()(inmodulepywin-auto.
timings),74AnimationWrapper(classinpywin-auto.
controls.
common_controls),92Application(classinpywinauto.
application),65AppNotConnected,65AppStartError,65AsianHotkeyTest()(inmodulepywin-auto.
tests.
asianhotkey),118assert_valid_process()(inmodulepywin-auto.
application),69AssertValidProcess()(inmodulepywinauto.
application),67automation_id(pywinauto.
uia_element_info.
UIAElementInfoattribute),127automation_id(pywinauto.
win32_element_info.
HwndElementInfoattribute),126automation_id()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),82automation_id()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),108BBackEnd(classinpywinauto.
backend),125BackendsRegistry(classinpywinauto.
backend),125band_count()(pywinauto.
controls.
common_controls.
ReBarWrappermethod),97BandCount()(pywinauto.
controls.
common_controls.
ReBarWrappermethod),97BaseMeta(classinpywinauto.
base_wrapper),76BaseWrapper(classinpywinauto.
base_wrapper),76border_widths()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98BorderWidths()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98build_condition()(pywinauto.
uia_denes.
IUIAmethod),129build_unique_dict()(inmodulepywin-auto.
ndbestmatch),70Button()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),99button()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100button()(pywinauto.
controls.
uia_controls.
ToolbarWrappermethod),116button_count()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100button_count()(pywin-auto.
controls.
uia_controls.
ToolbarWrapper139pywinautoDocumentation,Release0.
6.
8method),116ButtonCount()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100buttons()(pywinauto.
controls.
uia_controls.
ToolbarWrappermethod),116ButtonWrapper(classinpywin-auto.
controls.
uia_controls),111ButtonWrapper(classinpywin-auto.
controls.
win32_controls),103Ccalc_min_rectangle()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),92CalendarWrapper(classinpywin-auto.
controls.
common_controls),92can_be_label(pywinauto.
base_wrapper.
BaseWrapperat-tribute),76can_be_label(pywinauto.
controls.
hwndwrapper.
DialogWrapperattribute),81can_be_label(pywinauto.
controls.
uia_controls.
StaticWrapperattribute),116can_be_label(pywinauto.
controls.
win32_controls.
ButtonWrapperattribute),104can_be_label(pywinauto.
controls.
win32_controls.
StaticWrapperattribute),108can_select_multiple()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),108capture_as_image()(pywin-auto.
base_wrapper.
BaseWrappermethod),76cell()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114cells()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114check()(pywinauto.
controls.
common_controls.
_listview_itemmethod),90Check()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),94check()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95Check()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),103check()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104check_button()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100check_button()(pywin-auto.
controls.
uia_controls.
ToolbarWrappermethod),116check_by_click()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104check_by_click_input()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104CheckButton()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100CheckByClick()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104CheckByClickInput()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104CheckGuardSignature()(pywin-auto.
remote_memory_block.
RemoteMemoryBlockmethod),133child_window()(pywin-auto.
application.
WindowSpecicationmethod),67children()(inmodulepywinauto.
handleprops),130children()(pywinauto.
base_wrapper.
BaseWrappermethod),76children()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),89children()(pywinauto.
element_info.
ElementInfomethod),125children()(pywinauto.
uia_element_info.
UIAElementInfomethod),127children()(pywinauto.
win32_element_info.
HwndElementInfomethod),126children_texts()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),108class_name(pywinauto.
element_info.
ElementInfoattribute),125class_name(pywinauto.
uia_element_info.
UIAElementInfoattribute),127class_name(pywinauto.
win32_element_info.
HwndElementInfoattribute),126class_name()(pywinauto.
base_wrapper.
BaseWrappermethod),76classname()(inmodulepywinauto.
handleprops),130CleanUp()(pywinauto.
remote_memory_block.
RemoteMemoryBlockmethod),133click()(inmodulepywinauto.
mouse),63click()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91click()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89click()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),89click()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82click()(pywinauto.
controls.
menuwrapper.
MenuItem140IndexpywinautoDocumentation,Release0.
6.
8method),87click()(pywinauto.
controls.
uia_controls.
ButtonWrappermethod),111click()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104click_input()(pywinauto.
base_wrapper.
BaseWrappermethod),76click_input()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91click_input()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89click_input()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),89click_input()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88client_area_rect()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81client_rect()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90client_rect()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82client_rects()(pywinauto.
controls.
common_controls.
HeaderWrappermethod),94client_rects()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98client_rects()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98client_rects()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82client_to_screen()(pywin-auto.
base_wrapper.
BaseWrappermethod),77ClientAreaRect()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81clientrect()(inmodulepywinauto.
handleprops),130close()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82close()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),108close_alt_f4()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82close_click()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82collapse()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90collapse()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112collapse()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),108column_count()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95column_count()(pywin-auto.
controls.
uia_controls.
ListViewWrappermethod),114column_widths()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95ColumnCount()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),94Columns()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95columns()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95columns()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114ColumnWidths()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95ComboBoxDroppedHeightTest()(inmodulepywin-auto.
tests.
comboboxdroppedheight),119ComboBoxExWrapper(classinpywin-auto.
controls.
common_controls),93ComboBoxWrapper(classinpywin-auto.
controls.
uia_controls),112ComboBoxWrapper(classinpywin-auto.
controls.
win32_controls),105CompareToRefFontTest()(inmodulepywin-auto.
tests.
comparetoreffont),119connect()(pywinauto.
application.
Applicationmethod),66context_help_id()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),82contexthelpid()(inmodulepywinauto.
handleprops),130control_count()(pywinauto.
base_wrapper.
BaseWrappermethod),77control_id(pywinauto.
element_info.
ElementInfoat-tribute),125control_id(pywinauto.
uia_element_info.
UIAElementInfoattribute),128control_id(pywinauto.
win32_element_info.
HwndElementInfoattribute),126control_id()(pywinauto.
base_wrapper.
BaseWrappermethod),77control_type(pywinauto.
uia_element_info.
UIAElementInfoattribute),128control_type(pywinauto.
win32_element_info.
HwndElementInfoattribute),126control_type()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),82controlid()(inmodulepywinauto.
handleprops),130ControlNotEnabled,80ControlNotVisible,80ControlProps(classinpywinauto.
controlproperties),129Index141pywinautoDocumentation,Release0.
6.
8count()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92cpu_usage()(pywinauto.
application.
Applicationmethod),66DDateTimePickerWrapper(classinpywin-auto.
controls.
common_controls),93debug_message()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),82Decrement()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103decrement()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103Defaults()(pywinauto.
timings.
TimeCongmethod),73defaults()(pywinauto.
timings.
TimeCongmethod),73descendants()(pywinauto.
base_wrapper.
BaseWrappermethod),77descendants()(pywinauto.
element_info.
ElementInfomethod),125descendants()(pywinauto.
uia_element_info.
UIAElementInfomethod),128descendants()(pywinauto.
win32_element_info.
HwndElementInfomethod),127deselect()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91Deselect()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95deselect()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95DialogWrapper(classinpywin-auto.
controls.
hwndwrapper),80disable()(inmodulepywinauto.
actionlogger),132double_click()(inmodulepywinauto.
mouse),63double_click()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83double_click_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),77drag_mouse()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83drag_mouse_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),77draw_outline()(pywinauto.
base_wrapper.
BaseWrappermethod),77drop()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90dropped_rect()(pywin-auto.
controls.
win32_controls.
ComboBoxWrappermethod),105DroppedRect()(pywin-auto.
controls.
win32_controls.
ComboBoxWrappermethod),105dump_tree()(pywinauto.
application.
WindowSpecicationmethod),67dump_window()(pywinauto.
element_info.
ElementInfomethod),125dump_window()(pywin-auto.
uia_element_info.
UIAElementInfomethod),128dump_window()(pywin-auto.
win32_element_info.
HwndElementInfomethod),127dumpwindow()(inmodulepywinauto.
handleprops),130EEditWrapper(classinpywinauto.
controls.
uia_controls),112EditWrapper(classinpywin-auto.
controls.
win32_controls),105element(pywinauto.
uia_element_info.
UIAElementInfoattribute),128element_class(pywinauto.
backend.
BackendsRegistryat-tribute),125element_class()(inmodulepywinauto.
backend),125element_info(pywinauto.
base_wrapper.
BaseWrapperat-tribute),77ElementAmbiguousError,70ElementInfo(classinpywinauto.
element_info),125ElementNotEnabled,80ElementNotFoundError,70ElementNotVisible,80elements_from_uia_array()(inmodulepywin-auto.
uia_element_info),128EmptyClipboard()(inmodulepywinauto.
clipboard),75enable()(inmodulepywinauto.
actionlogger),132enabled(pywinauto.
element_info.
ElementInfoattribute),125enabled(pywinauto.
uia_element_info.
UIAElementInfoattribute),128enabled(pywinauto.
win32_element_info.
HwndElementInfoattribute),127ensure_accessible()(inmodulepywin-auto.
controls.
menuwrapper),89ensure_visible()(pywin-auto.
controls.
common_controls.
_listview_itemmethod),91ensure_visible()(pywin-auto.
controls.
common_controls.
_treeview_elementmethod),90ensure_visible()(pywin-auto.
controls.
common_controls.
TreeViewWrappermethod),102ensure_visible()(pywin-auto.
controls.
uia_controls.
TreeItemWrappermethod),117142IndexpywinautoDocumentation,Release0.
6.
8EnsureVisible()(pywin-auto.
controls.
common_controls.
TreeViewWrappermethod),101enum_windows()(inmodulepywinauto.
ndwindows),70exists()(pywinauto.
application.
WindowSpecicationmethod),67expand()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90expand()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112expand()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),108exstyle()(inmodulepywinauto.
handleprops),130exstyle()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83FFast()(pywinauto.
timings.
TimeCongmethod),73fast()(pywinauto.
timings.
TimeCongmethod),73lter_with_depth()(pywin-auto.
element_info.
ElementInfostaticmethod),126nd_best_control_matches()(inmodulepywin-auto.
ndbestmatch),70nd_best_match()(inmodulepywinauto.
ndbestmatch),70nd_best_matches()(pywin-auto.
ndbestmatch.
UniqueDictmethod),69nd_element()(inmodulepywinauto.
ndwindows),70nd_elements()(inmodulepywinauto.
ndwindows),70nd_window()(inmodulepywinauto.
ndwindows),71nd_windows()(inmodulepywinauto.
ndwindows),71nd_wrapper()(pywinauto.
base_wrapper.
BaseMetastaticmethod),76nd_wrapper()(pywin-auto.
controls.
hwndwrapper.
HwndMetastaticmethod),81nd_wrapper()(pywinauto.
controls.
uiawrapper.
UiaMetastaticmethod),111font()(inmodulepywinauto.
handleprops),130font()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83fonts()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83force_close()(pywinauto.
controls.
hwndwrapper.
DialogWrappermethod),81framework_id(pywinauto.
element_info.
ElementInfoat-tribute),126framework_id(pywinauto.
uia_element_info.
UIAElementInfoattribute),128friendly_class_name()(pywin-auto.
base_wrapper.
BaseWrappermethod),77friendly_class_name()(pywin-auto.
controls.
menuwrapper.
MenuItemmethod),88friendly_class_name()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),108friendly_class_name()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104friendlyclassname(pywin-auto.
base_wrapper.
BaseWrapperattribute),77friendlyclassname(pywin-auto.
controls.
common_controls.
AnimationWrapperattribute),92friendlyclassname(pywin-auto.
controls.
common_controls.
CalendarWrapperattribute),92friendlyclassname(pywin-auto.
controls.
common_controls.
ComboBoxExWrapperattribute),93friendlyclassname(pywin-auto.
controls.
common_controls.
DateTimePickerWrapperattribute),93friendlyclassname(pywin-auto.
controls.
common_controls.
HeaderWrapperattribute),94friendlyclassname(pywin-auto.
controls.
common_controls.
HotkeyWrapperattribute),94friendlyclassname(pywin-auto.
controls.
common_controls.
IPAddressWrapperattribute),94friendlyclassname(pywin-auto.
controls.
common_controls.
ListViewWrapperattribute),95friendlyclassname(pywin-auto.
controls.
common_controls.
PagerWrapperattribute),96friendlyclassname(pywin-auto.
controls.
common_controls.
ProgressWrapperattribute),97friendlyclassname(pywin-auto.
controls.
common_controls.
ReBarWrapperattribute),97friendlyclassname(pywin-auto.
controls.
common_controls.
StatusBarWrapperattribute),98friendlyclassname(pywin-auto.
controls.
common_controls.
TabControlWrapperattribute),98friendlyclassname(pywin-auto.
controls.
common_controls.
ToolbarWrapperIndex143pywinautoDocumentation,Release0.
6.
8attribute),100friendlyclassname(pywin-auto.
controls.
common_controls.
ToolTipsWrapperattribute),99friendlyclassname(pywin-auto.
controls.
common_controls.
TrackbarWrapperattribute),101friendlyclassname(pywin-auto.
controls.
common_controls.
TreeViewWrapperattribute),102friendlyclassname(pywin-auto.
controls.
common_controls.
UpDownWrapperattribute),103friendlyclassname(pywin-auto.
controls.
hwndwrapper.
DialogWrapperattribute),81friendlyclassname(pywin-auto.
controls.
win32_controls.
ButtonWrapperattribute),104friendlyclassname(pywin-auto.
controls.
win32_controls.
ComboBoxWrapperattribute),105friendlyclassname(pywin-auto.
controls.
win32_controls.
EditWrapperattribute),106friendlyclassname(pywin-auto.
controls.
win32_controls.
ListBoxWrapperattribute),107friendlyclassname(pywin-auto.
controls.
win32_controls.
PopupMenuWrapperattribute),107friendlyclassname(pywin-auto.
controls.
win32_controls.
StaticWrapperattribute),108from_point()(pywinauto.
base_wrapper.
BaseWrappermethod),78from_point()(pywinauto.
uia_element_info.
UIAElementInfoclassmethod),128from_point()(pywinauto.
win32_element_info.
HwndElementInfoclassmethod),127full_control_type(pywin-auto.
win32_element_info.
HwndElementInfoattribute),127full_control_type()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),83FuncWrapper(classinpywinauto.
controlproperties),129FuzzyDict(classinpywinauto.
fuzzydict),132Gget_active()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83get_band()(pywinauto.
controls.
common_controls.
ReBarWrappermethod),97get_base()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103get_border()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92get_buddy_control()(pywin-auto.
controls.
common_controls.
UpDownWrappermethod),103get_button()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100get_button_rect()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100get_button_struct()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100get_channel_rect()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_check_state()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104get_child()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90get_child()(pywinauto.
controls.
uia_controls.
TreeItemWrappermethod),117get_column()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95get_column()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114get_column_rectangle()(pywin-auto.
controls.
common_controls.
HeaderWrappermethod),94get_column_text()(pywin-auto.
controls.
common_controls.
HeaderWrappermethod),94get_control_names()(inmodulepywin-auto.
ndbestmatch),70get_current_date()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),92get_dialog_props_from_handle()(inmodulepywin-auto.
controls.
hwndwrapper),86get_elem_interface()(inmodulepywinauto.
uia_denes),129get_expand_state()(pywin-auto.
controls.
uia_controls.
ComboBoxWrappermethod),112get_expand_state()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),109get_rst_weekday()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),92get_focus()(pywinauto.
controls.
hwndwrapper.
HwndWrapper144IndexpywinautoDocumentation,Release0.
6.
8method),83get_header_control()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95get_header_control()(pywin-auto.
controls.
uia_controls.
ListViewWrappermethod),114get_header_controls()(pywin-auto.
controls.
uia_controls.
ListViewWrappermethod),114get_id()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92get_item()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95get_item()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102get_item()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114get_item()(pywinauto.
controls.
uia_controls.
TreeViewWrappermethod),117get_item_focus()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107get_item_rect()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95get_item_rect()(pywin-auto.
controls.
uia_controls.
ListViewWrappermethod),114get_items()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114get_line()(pywinauto.
controls.
uia_controls.
EditWrappermethod),112get_line()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106get_line_size()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_menu_path()(pywin-auto.
controls.
menuwrapper.
Menumethod),87get_month_delta()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),92get_month_range()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),92get_non_text_control_name()(inmodulepywin-auto.
ndbestmatch),70get_num_ticks()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_page_size()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_part_rect()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98get_part_text()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98get_position()(pywinauto.
controls.
common_controls.
PagerWrappermethod),96get_position()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97get_position()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101get_properties()(pywinauto.
base_wrapper.
BaseWrappermethod),78get_properties()(pywin-auto.
controls.
common_controls.
TabControlWrappermethod),98get_properties()(pywin-auto.
controls.
common_controls.
TreeViewWrappermethod),102get_properties()(pywinauto.
controls.
menuwrapper.
Menumethod),87get_properties()(pywin-auto.
controls.
menuwrapper.
MenuItemmethod),88get_properties()(pywin-auto.
controls.
win32_controls.
ComboBoxWrappermethod),105get_range()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103get_range_max()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_range_min()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_sel_end()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101get_sel_start()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101get_selected_count()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95get_selected_count()(pywin-auto.
controls.
uia_controls.
ListViewWrappermethod),114get_selected_tab()(pywin-auto.
controls.
common_controls.
TabControlWrappermethod),99get_selected_tab()(pywin-auto.
controls.
uia_controls.
TabControlWrappermethod),116get_selection()(pywin-Index145pywinautoDocumentation,Release0.
6.
8auto.
controls.
uiawrapper.
UIAWrappermethod),109get_show_state()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),83get_show_state()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),109get_state()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97get_step()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97get_tab_rect()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99get_tab_text()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99get_time()(pywinauto.
controls.
common_controls.
DateTimePickerWrappermethod),93get_tip()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99get_tip_text()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99get_today()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92get_toggle_state()(pywin-auto.
controls.
uia_controls.
ButtonWrappermethod),111get_tool_tips_control()(pywin-auto.
controls.
common_controls.
ReBarWrappermethod),97get_tool_tips_control()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100get_toolbar()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83get_tooltips_control()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101get_value()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103get_value()(pywinauto.
controls.
uia_controls.
EditWrappermethod),112get_view()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92GetBand()(pywinauto.
controls.
common_controls.
ReBarWrappermethod),97GetBase()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103GetBuddyControl()(pywin-auto.
controls.
common_controls.
UpDownWrappermethod),103GetButton()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100GetButtonRect()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100GetButtonStruct()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100GetCheckState()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104GetClipboardFormats()(inmodulepywinauto.
clipboard),75GetColumn()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95GetColumnRectangle()(pywin-auto.
controls.
common_controls.
HeaderWrappermethod),94GetColumnText()(pywin-auto.
controls.
common_controls.
HeaderWrappermethod),94GetData()(inmodulepywinauto.
clipboard),75GetFormatName()(inmodulepywinauto.
clipboard),75GetHeaderControl()(pywin-auto.
controls.
common_controls.
ListViewWrappermethod),95GetHotkey()(inmodulepywinauto.
tests.
repeatedhotkey),123GetItem()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95GetItem()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),101GetItemFocus()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),106GetItemRect()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95GetLeadSpaces()(inmodulepywin-auto.
tests.
leadtrailspaces),120GetLine()(pywinauto.
controls.
win32_controls.
EditWrappermethod),105GetMatchHistoryItem()(pywin-auto.
application.
Applicationmethod),65GetMenuBlocks()(inmodulepywin-auto.
controlproperties),129GetPartRect()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98GetPartText()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98GetPosition()(pywinauto.
controls.
common_controls.
PagerWrappermethod),96GetPosition()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),96GetRange()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103GetSelectedCount()(pywin-auto.
controls.
common_controls.
ListViewWrapper146IndexpywinautoDocumentation,Release0.
6.
8method),95GetSelectedTab()(pywin-auto.
controls.
common_controls.
TabControlWrappermethod),98GetState()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97GetStep()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97GetTabRect()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98GetTabText()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98GetTime()(pywinauto.
controls.
common_controls.
DateTimePickerWrappermethod),93GetTip()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99GetTipText()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99GetToolTipsControl()(pywin-auto.
controls.
common_controls.
ReBarWrappermethod),97GetToolTipsControl()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100GetTrailSpaces()(inmodulepywin-auto.
tests.
leadtrailspaces),120GetValue()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103Hhandle(pywinauto.
controls.
hwndwrapper.
HwndWrapperattribute),83handle(pywinauto.
element_info.
ElementInfoattribute),126handle(pywinauto.
uia_element_info.
UIAElementInfoat-tribute),128handle(pywinauto.
win32_element_info.
HwndElementInfoattribute),127has_depth()(pywinauto.
element_info.
ElementInfomethod),126has_enough_privileges()(inmodulepywin-auto.
handleprops),130has_exstyle()(inmodulepywinauto.
handleprops),130has_exstyle()(pywinauto.
controlproperties.
ControlPropsmethod),129has_exstyle()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83has_focus()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),83has_keyboard_focus()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),84has_keyboard_focus()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),109has_style()(inmodulepywinauto.
handleprops),130has_style()(pywinauto.
controlproperties.
ControlPropsmethod),129has_style()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89has_style()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84has_title(pywinauto.
base_wrapper.
BaseWrapperat-tribute),78has_title(pywinauto.
controls.
common_controls.
CalendarWrapperattribute),92has_title(pywinauto.
controls.
common_controls.
ComboBoxExWrapperattribute),93has_title(pywinauto.
controls.
common_controls.
DateTimePickerWrapperattribute),93has_title(pywinauto.
controls.
common_controls.
HotkeyWrapperattribute),94has_title(pywinauto.
controls.
common_controls.
IPAddressWrapperattribute),94has_title(pywinauto.
controls.
common_controls.
ProgressWrapperattribute),97has_title(pywinauto.
controls.
uia_controls.
EditWrapperattribute),113has_title(pywinauto.
controls.
uia_controls.
SliderWrapperattribute),115has_title(pywinauto.
controls.
win32_controls.
ComboBoxWrapperattribute),105has_title(pywinauto.
controls.
win32_controls.
EditWrapperattribute),106has_title(pywinauto.
controls.
win32_controls.
ListBoxWrapperattribute),107has_title(pywinauto.
controls.
win32_controls.
PopupMenuWrapperattribute),107HasExStyle()(pywinauto.
controlproperties.
ControlPropsmethod),129HasStyle()(pywinauto.
controlproperties.
ControlPropsmethod),129HeaderItemWrapper(classinpywin-auto.
controls.
uia_controls),113HeaderWrapper(classinpywin-auto.
controls.
common_controls),94HeaderWrapper(classinpywin-auto.
controls.
uia_controls),113hide_from_taskbar()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81HideFromTaskbar()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81hit_test()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),92Hook(classinpywinauto.
win32_hooks),75hook()(pywinauto.
win32_hooks.
Hookmethod),75Index147pywinautoDocumentation,Release0.
6.
8HotkeyWrapper(classinpywin-auto.
controls.
common_controls),94HwndElementInfo(classinpywin-auto.
win32_element_info),126HwndMeta(classinpywinauto.
controls.
hwndwrapper),81HwndWrapper(classinpywin-auto.
controls.
hwndwrapper),81Iiface_expand_collapse(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_grid(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_grid_item(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_invoke(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_item_container(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_range_value(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_scroll(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_scroll_item(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_selection(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_selection_item(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_table(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_table_item(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_text(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_toggle(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_transform(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_transformV2(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_value(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),109iface_virtualized_item(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),109iface_window(pywinauto.
controls.
uiawrapper.
UIAWrapperattribute),110image()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91ImplementsHotkey()(inmodulepywin-auto.
tests.
repeatedhotkey),123Increment()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103increment()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103indent()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91index()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88inplace_control()(pywin-auto.
controls.
common_controls.
_listview_itemmethod),91InvalidElement,80InvalidWindowHandle,86invoke()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110IPAddressWrapper(classinpywin-auto.
controls.
common_controls),94is64bit()(pywinauto.
application.
Applicationmethod),66is64bitbinary()(inmodulepywinauto.
handleprops),130is64bitprocess()(inmodulepywinauto.
handleprops),130is_above_or_to_left()(inmodulepywin-auto.
ndbestmatch),70is_active()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84is_active()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_checkable()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89is_checked()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91is_checked()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89is_checked()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90is_checked()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96is_checked()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88is_checked()(pywinauto.
controls.
uia_controls.
ListItemWrappermethod),113is_checked()(pywinauto.
controls.
uia_controls.
TreeItemWrappermethod),117is_checked()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104is_child()(pywinauto.
base_wrapper.
BaseWrapper148IndexpywinautoDocumentation,Release0.
6.
8method),78is_collapsed()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_dialog()(pywinauto.
base_wrapper.
BaseWrappermethod),78is_dialog()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84is_dialog()(pywinauto.
controls.
uia_controls.
ButtonWrappermethod),112is_dialog()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_dialog()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104is_dialog()(pywinauto.
controls.
win32_controls.
PopupMenuWrappermethod),107is_editable()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112is_editable()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113is_enabled()(pywinauto.
base_wrapper.
BaseWrappermethod),78is_enabled()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89is_enabled()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88is_expanded()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90is_expanded()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_focused()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91is_focused()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96is_hooked()(pywinauto.
win32_hooks.
Hookmethod),75is_in_taskbar()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81is_keyboard_focusable()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),110is_maximized()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),84is_maximized()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),110is_minimized()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),84is_minimized()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),110is_normal()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84is_normal()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_pressable()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89is_pressed()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89is_process_running()(pywinauto.
application.
Applicationmethod),66is_selected()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91is_selected()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90is_selected()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96is_selected()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102is_selected()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110is_selection_required()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),110is_single_selection()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107is_toplevel_window()(inmodulepywin-auto.
handleprops),130is_unicode()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84is_visible()(pywinauto.
base_wrapper.
BaseWrappermethod),78is_x64_OS()(inmodulepywinauto.
sysinfo),132is_x64_Python()(inmodulepywinauto.
sysinfo),132isenabled()(inmodulepywinauto.
handleprops),130IsFocused()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95IsInTaskbar()(pywinauto.
controls.
hwndwrapper.
DialogWrappermethod),81IsSelected()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95IsSelected()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),101IsSingleSelection()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),106isunicode()(inmodulepywinauto.
handleprops),130isvisible()(inmodulepywinauto.
handleprops),130iswindow()(inmodulepywinauto.
handleprops),131item()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91item()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90Item()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95item()(pywinauto.
controls.
common_controls.
ListViewWrapperIndex149pywinautoDocumentation,Release0.
6.
8method),96Item()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102item()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102item()(pywinauto.
controls.
menuwrapper.
Menumethod),87item()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114item_by_index()(pywin-auto.
controls.
uia_controls.
MenuWrappermethod),115item_by_path()(pywin-auto.
controls.
uia_controls.
MenuWrappermethod),115item_count()(pywinauto.
controls.
common_controls.
HeaderWrappermethod),94item_count()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96item_count()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102item_count()(pywinauto.
controls.
menuwrapper.
Menumethod),87item_count()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112item_count()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114item_count()(pywinauto.
controls.
uia_controls.
TreeViewWrappermethod),117item_count()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105item_count()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107item_data()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91item_data()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105item_data()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107item_id()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88item_rect()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107item_texts()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105item_texts()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107item_type()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88ItemCount()(pywinauto.
controls.
common_controls.
HeaderWrappermethod),94ItemCount()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95ItemCount()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102ItemCount()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105ItemCount()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),106ItemData()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105ItemData()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107ItemRect()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107Items()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95items()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96items()(pywinauto.
controls.
menuwrapper.
Menumethod),87items()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114items()(pywinauto.
controls.
uia_controls.
MenuItemWrappermethod),115items()(pywinauto.
controls.
uia_controls.
MenuWrappermethod),115ItemTexts()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105ItemTexts()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107iter_children()(pywinauto.
base_wrapper.
BaseWrappermethod),78iter_children()(pywinauto.
element_info.
ElementInfomethod),126iter_children()(pywinauto.
uia_element_info.
UIAElementInfomethod),128iter_children()(pywinauto.
win32_element_info.
HwndElementInfomethod),127iter_descendants()(pywin-auto.
base_wrapper.
BaseWrappermethod),78iter_descendants()(pywinauto.
element_info.
ElementInfomethod),126IUIA(classinpywinauto.
uia_denes),129KKeyboardEvent(classinpywinauto.
win32_hooks),76kill()(pywinauto.
application.
Applicationmethod),66Llarge_change()(pywin-auto.
controls.
uia_controls.
SliderWrappermethod),115lazy_property(inmodulepywin-auto.
controls.
uiawrapper),111LazyProperty(classinpywinauto.
controls.
uiawrapper),108150IndexpywinautoDocumentation,Release0.
6.
8LeadTrailSpacesTest()(inmodulepywin-auto.
tests.
leadtrailspaces),120legacy_properties()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),110line_count()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113line_count()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106line_length()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113line_length()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106LineCount()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106LineLength()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106ListBoxWrapper(classinpywin-auto.
controls.
win32_controls),106listen()(pywinauto.
win32_hooks.
Hookmethod),75ListItemWrapper(classinpywin-auto.
controls.
uia_controls),113ListViewWrapper(classinpywin-auto.
controls.
common_controls),94ListViewWrapper(classinpywin-auto.
controls.
uia_controls),113MMatchError,69max_value()(pywinauto.
controls.
uia_controls.
SliderWrappermethod),115maximize()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84maximize()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110Menu(classinpywinauto.
controls.
menuwrapper),87menu()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84menu_bar_click_input()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100menu_item()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84menu_items()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84menu_select()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84menu_select()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),110MenuBarClickInput()(pywin-auto.
controls.
common_controls.
ToolbarWrappermethod),100MenuBlockAsControls()(inmodulepywin-auto.
controlproperties),129MenuInaccessible,87MenuInfo(classinpywinauto.
controls.
menuwrapper),87MenuItem(classinpywinauto.
controls.
menuwrapper),87MenuItemAsControl()(inmodulepywin-auto.
controlproperties),129MenuItemInfo(classinpywin-auto.
controls.
menuwrapper),88MenuItemNotEnabled,88MenuItemWrapper(classinpywin-auto.
controls.
uia_controls),115MenuWrapper(classinpywinauto.
controls.
uia_controls),115min_value()(pywinauto.
controls.
uia_controls.
SliderWrappermethod),115minimize()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),84minimize()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),111MiscValuesTest()(inmodulepywin-auto.
tests.
miscvalues),121MissalignmentTest()(inmodulepywin-auto.
tests.
missalignment),121MissingExtraStringTest()(inmodulepywin-auto.
tests.
missingextrastring),122MouseEvent(classinpywinauto.
win32_hooks),76move()(inmodulepywinauto.
mouse),63move_mouse()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),84move_mouse_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),78move_window()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),84Nname(pywinauto.
backend.
BackendsRegistryattribute),125name(pywinauto.
element_info.
ElementInfoattribute),126name(pywinauto.
uia_element_info.
UIAElementInfoat-tribute),128name(pywinauto.
win32_element_info.
HwndElementInfoattribute),127name()(inmodulepywinauto.
backend),125next_item()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90NoPatternInterfaceError,129notify_parent()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85Index151pywinautoDocumentation,Release0.
6.
8OOptRect(classinpywinauto.
tests.
overlapping),123os_arch()(inmodulepywinauto.
sysinfo),132OverlappingTest()(inmodulepywin-auto.
tests.
overlapping),123owner()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85PPagerWrapper(classinpywin-auto.
controls.
common_controls),96parent(pywinauto.
element_info.
ElementInfoattribute),126parent(pywinauto.
uia_element_info.
UIAElementInfoat-tribute),128parent(pywinauto.
win32_element_info.
HwndElementInfoattribute),127parent()(inmodulepywinauto.
handleprops),131parent()(pywinauto.
base_wrapper.
BaseWrappermethod),78part_count()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98part_right_edges()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98PartCount()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98PartRightEdges()(pywin-auto.
controls.
common_controls.
StatusBarWrappermethod),98place_in_calendar(pywin-auto.
controls.
common_controls.
CalendarWrapperattribute),92popup_window()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85PopupMenuWrapper(classinpywin-auto.
controls.
win32_controls),107post_command()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85post_message()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85press()(inmodulepywinauto.
mouse),63press_button()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100press_mouse()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85press_mouse_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),79PressButton()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100print_control_identiers()(pywin-auto.
application.
WindowSpecicationmethod),68print_ctrl_ids()(pywin-auto.
application.
WindowSpecicationmethod),68print_items()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102print_items()(pywinauto.
controls.
uia_controls.
TreeViewWrappermethod),117PrintItems()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102process_from_module()(inmodulepywin-auto.
application),69process_get_modules()(inmodulepywin-auto.
application),69process_id(pywinauto.
element_info.
ElementInfoat-tribute),126process_id(pywinauto.
uia_element_info.
UIAElementInfoattribute),128process_id(pywinauto.
win32_element_info.
HwndElementInfoattribute),127process_id()(pywinauto.
base_wrapper.
BaseWrappermethod),79process_module()(inmodulepywinauto.
application),69processid()(inmodulepywinauto.
handleprops),131ProcessNotFoundError,67ProgressWrapper(classinpywin-auto.
controls.
common_controls),96python_bitness()(inmodulepywinauto.
sysinfo),132pywinauto.
actionlogger(module),132pywinauto.
application(module),65pywinauto.
backend(module),125pywinauto.
base_wrapper(module),76pywinauto.
clipboard(module),75pywinauto.
controlproperties(module),129pywinauto.
controls.
common_controls(module),89pywinauto.
controls.
hwndwrapper(module),80pywinauto.
controls.
menuwrapper(module),87pywinauto.
controls.
uia_controls(module),111pywinauto.
controls.
uiawrapper(module),108pywinauto.
controls.
win32_controls(module),103pywinauto.
element_info(module),125pywinauto.
ndbestmatch(module),69pywinauto.
ndwindows(module),70pywinauto.
fuzzydict(module),131pywinauto.
handleprops(module),130pywinauto.
keyboard(module),63pywinauto.
mouse(module),63pywinauto.
remote_memory_block(module),132pywinauto.
sysinfo(module),132pywinauto.
tests.
allcontrols(module),117pywinauto.
tests.
asianhotkey(module),118pywinauto.
tests.
comboboxdroppedheight(module),119152IndexpywinautoDocumentation,Release0.
6.
8pywinauto.
tests.
comparetoreffont(module),119pywinauto.
tests.
leadtrailspaces(module),120pywinauto.
tests.
miscvalues(module),120pywinauto.
tests.
missalignment(module),121pywinauto.
tests.
missingextrastring(module),121pywinauto.
tests.
overlapping(module),122pywinauto.
tests.
repeatedhotkey(module),123pywinauto.
tests.
translation(module),123pywinauto.
tests.
truncation(module),124pywinauto.
timings(module),72pywinauto.
uia_denes(module),129pywinauto.
uia_element_info(module),127pywinauto.
win32_element_info(module),126pywinauto.
win32_hooks(module),75pywinauto.
xml_helpers(module),131RRead()(pywinauto.
remote_memory_block.
RemoteMemoryBlockmethod),133ReadPropertiesFromFile()(inmodulepywin-auto.
xml_helpers),131ReBarWrapper(classinpywin-auto.
controls.
common_controls),97rectangle(pywinauto.
element_info.
ElementInfoat-tribute),126rectangle(pywinauto.
uia_element_info.
UIAElementInfoattribute),128rectangle(pywinauto.
win32_element_info.
HwndElementInfoattribute),127rectangle()(inmodulepywinauto.
handleprops),131rectangle()(pywinauto.
base_wrapper.
BaseWrappermethod),79rectangle()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91rectangle()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89rectangle()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88register()(inmodulepywinauto.
backend),125release()(inmodulepywinauto.
mouse),63release_mouse()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85release_mouse_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),79RemoteMemoryBlock(classinpywin-auto.
remote_memory_block),132remove_non_alphanumeric_symbols()(inmodulepywin-auto.
base_wrapper),80RepeatedHotkeyTest()(inmodulepywin-auto.
tests.
repeatedhotkey),123reset_level()(inmodulepywinauto.
actionlogger),132restore()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85restore()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),111rich_text(pywinauto.
element_info.
ElementInfoat-tribute),126rich_text(pywinauto.
uia_element_info.
UIAElementInfoattribute),128rich_text(pywinauto.
win32_element_info.
HwndElementInfoattribute),127right_click()(inmodulepywinauto.
mouse),63right_click()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85right_click_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),79root()(pywinauto.
base_wrapper.
BaseWrappermethod),79Root()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102Roots()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102roots()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102roots()(pywinauto.
controls.
uia_controls.
TreeViewWrappermethod),117row_count()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99RowCount()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98run_tests()(pywinauto.
controls.
hwndwrapper.
DialogWrappermethod),81RunTests()(pywinauto.
controls.
hwndwrapper.
DialogWrappermethod),81runtime_id(pywinauto.
uia_element_info.
UIAElementInfoattribute),128Sscroll()(inmodulepywinauto.
mouse),63scroll()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85scroll()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),111select()(pywinauto.
controls.
common_controls.
_listview_itemmethod),91select()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90Select()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95select()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96Select()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98Index153pywinautoDocumentation,Release0.
6.
8select()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99Select()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102select()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102select()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88select()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112select()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113select()(pywinauto.
controls.
uia_controls.
MenuItemWrappermethod),115select()(pywinauto.
controls.
uia_controls.
TabControlWrappermethod),116select()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),111Select()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105select()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105Select()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106select()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106Select()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107select()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107selected_index()(pywin-auto.
controls.
uia_controls.
ComboBoxWrappermethod),112selected_index()(pywin-auto.
controls.
win32_controls.
ComboBoxWrappermethod),105selected_indices()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107selected_item_index()(pywin-auto.
controls.
uiawrapper.
UIAWrappermethod),111selected_text()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112selected_text()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105SelectedIndex()(pywin-auto.
controls.
win32_controls.
ComboBoxWrappermethod),105SelectedIndices()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107SelectedText()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105selection_indices()(pywin-auto.
controls.
uia_controls.
EditWrappermethod),113selection_indices()(pywin-auto.
controls.
win32_controls.
EditWrappermethod),106SelectionIndices()(pywin-auto.
controls.
win32_controls.
EditWrappermethod),106send_chars()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),85send_command()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85send_keystrokes()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),85send_message()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86send_message_timeout()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86set_application_data()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86set_base()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103set_border()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),93set_cache_strategy()(pywin-auto.
element_info.
ElementInfomethod),126set_cache_strategy()(pywin-auto.
uia_element_info.
UIAElementInfomethod),128set_cache_strategy()(pywin-auto.
win32_element_info.
HwndElementInfomethod),127set_check_indeterminate()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104set_color()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),93set_current_date()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),93set_day_states()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),93set_edit_text()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113set_edit_text()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106154IndexpywinautoDocumentation,Release0.
6.
8set_rst_weekday()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),93set_focus()(pywinauto.
base_wrapper.
BaseWrappermethod),79set_focus()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),86set_focus()(pywinauto.
controls.
uiawrapper.
UIAWrappermethod),111set_id()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),93set_item_focus()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107set_keyboard_focus()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86set_level()(inmodulepywinauto.
actionlogger),132set_line_size()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101set_month_delta()(pywin-auto.
controls.
common_controls.
CalendarWrappermethod),93set_page_size()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101set_position()(pywinauto.
controls.
common_controls.
PagerWrappermethod),96set_position()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97set_position()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101set_range_max()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101set_range_min()(pywin-auto.
controls.
common_controls.
TrackbarWrappermethod),101set_sel()(pywinauto.
controls.
common_controls.
TrackbarWrappermethod),101set_text()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113set_text()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106set_time()(pywinauto.
controls.
common_controls.
DateTimePickerWrappermethod),93set_today()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),93set_transparency()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86set_value()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103set_value()(pywinauto.
controls.
uia_controls.
SliderWrappermethod),115set_view()(pywinauto.
controls.
common_controls.
CalendarWrappermethod),93set_window_text()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86set_window_text()(pywin-auto.
controls.
uia_controls.
EditWrappermethod),113set_window_text()(pywin-auto.
controls.
win32_controls.
EditWrappermethod),106SetBase()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103SetCheckIndeterminate()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104SetEditText()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106SetItemFocus()(pywin-auto.
controls.
win32_controls.
ListBoxWrappermethod),107SetPosition()(pywinauto.
controls.
common_controls.
PagerWrappermethod),96SetPosition()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97SetReferenceControls()(inmodulepywin-auto.
controlproperties),129SetText()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106SetTime()(pywinauto.
controls.
common_controls.
DateTimePickerWrappermethod),93SetValue()(pywinauto.
controls.
common_controls.
UpDownWrappermethod),103show_in_taskbar()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81ShowInTaskbar()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81SliderWrapper(classinpywinauto.
controls.
uia_controls),115Slow()(pywinauto.
timings.
TimeCongmethod),73slow()(pywinauto.
timings.
TimeCongmethod),73small_change()(pywin-auto.
controls.
uia_controls.
SliderWrappermethod),115start()(pywinauto.
application.
Applicationmethod),66start_dragging()(pywin-auto.
controls.
common_controls.
_treeview_elementmethod),90state()(pywinauto.
controls.
common_controls.
_listview_itemmethod),92state()(pywinauto.
controls.
common_controls.
_toolbar_buttonIndex155pywinautoDocumentation,Release0.
6.
8method),89state()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90state()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88StaticWrapper(classinpywinauto.
controls.
uia_controls),115StaticWrapper(classinpywin-auto.
controls.
win32_controls),108StatusBarWrapper(classinpywin-auto.
controls.
common_controls),97step_it()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97StepIt()(pywinauto.
controls.
common_controls.
ProgressWrappermethod),97stop()(pywinauto.
win32_hooks.
Hookmethod),76style()(inmodulepywinauto.
handleprops),131style()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89style()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),86sub_elements()(pywin-auto.
controls.
common_controls.
_treeview_elementmethod),90sub_elements()(pywin-auto.
controls.
uia_controls.
TreeItemWrappermethod),117sub_menu()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88Ttab_count()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99tab_count()(pywinauto.
controls.
uia_controls.
TabControlWrappermethod),116TabControlWrapper(classinpywin-auto.
controls.
common_controls),98TabControlWrapper(classinpywin-auto.
controls.
uia_controls),116TabCount()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),98text()(inmodulepywinauto.
handleprops),131text()(pywinauto.
controls.
common_controls.
_listview_itemmethod),92text()(pywinauto.
controls.
common_controls.
_toolbar_buttonmethod),89text()(pywinauto.
controls.
common_controls.
_treeview_elementmethod),90text()(pywinauto.
controls.
menuwrapper.
MenuItemmethod),88text_block()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113text_block()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106TextBlock()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106texts()(pywinauto.
base_wrapper.
BaseWrappermethod),79texts()(pywinauto.
controls.
common_controls.
HeaderWrappermethod),94texts()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96texts()(pywinauto.
controls.
common_controls.
ReBarWrappermethod),97texts()(pywinauto.
controls.
common_controls.
StatusBarWrappermethod),98texts()(pywinauto.
controls.
common_controls.
TabControlWrappermethod),99texts()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100texts()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99texts()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102texts()(pywinauto.
controls.
uia_controls.
ComboBoxWrappermethod),112texts()(pywinauto.
controls.
uia_controls.
EditWrappermethod),113texts()(pywinauto.
controls.
uia_controls.
ListItemWrappermethod),113texts()(pywinauto.
controls.
uia_controls.
ListViewWrappermethod),114texts()(pywinauto.
controls.
uia_controls.
TabControlWrappermethod),116texts()(pywinauto.
controls.
uia_controls.
ToolbarWrappermethod),116texts()(pywinauto.
controls.
win32_controls.
ComboBoxWrappermethod),105texts()(pywinauto.
controls.
win32_controls.
EditWrappermethod),106texts()(pywinauto.
controls.
win32_controls.
ListBoxWrappermethod),107TimeCong(classinpywinauto.
timings),73TimeoutError,73timestamp()(inmodulepywinauto.
timings),74tip_texts()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100TipTexts()(pywinauto.
controls.
common_controls.
ToolbarWrappermethod),100toggle()(pywinauto.
controls.
uia_controls.
ButtonWrappermethod),112tool_count()(pywinauto.
controls.
common_controls.
ToolTipsWrappermethod),99ToolbarWrapper(classinpywin-auto.
controls.
common_controls),99ToolbarWrapper(classinpywin-auto.
controls.
uia_controls),116ToolCount()(pywinauto.
controls.
common_controls.
ToolTipsWrapper156IndexpywinautoDocumentation,Release0.
6.
8method),99ToolTip(classinpywinauto.
controls.
common_controls),99ToolTipsWrapper(classinpywin-auto.
controls.
common_controls),99TooltipWrapper(classinpywin-auto.
controls.
uia_controls),116top_from_point()(pywin-auto.
base_wrapper.
BaseWrappermethod),79top_from_point()(pywin-auto.
uia_element_info.
UIAElementInfoclassmethod),128top_from_point()(pywin-auto.
win32_element_info.
HwndElementInfoclassmethod),127top_level_parent()(pywin-auto.
base_wrapper.
BaseWrappermethod),79top_window()(pywinauto.
application.
Applicationmethod),66TrackbarWrapper(classinpywin-auto.
controls.
common_controls),100TranslationTest()(inmodulepywinauto.
tests.
translation),124tree_root()(pywinauto.
controls.
common_controls.
TreeViewWrappermethod),102TreeItemWrapper(classinpywin-auto.
controls.
uia_controls),116TreeViewWrapper(classinpywin-auto.
controls.
common_controls),101TreeViewWrapper(classinpywin-auto.
controls.
uia_controls),117TruncationTest()(inmodulepywinauto.
tests.
truncation),124type_keys()(pywinauto.
base_wrapper.
BaseWrappermethod),79UUIAElementInfo(classinpywinauto.
uia_element_info),127UiaMeta(classinpywinauto.
controls.
uiawrapper),111UIAWrapper(classinpywinauto.
controls.
uiawrapper),108uncheck()(pywinauto.
controls.
common_controls.
_listview_itemmethod),92UnCheck()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),95uncheck()(pywinauto.
controls.
common_controls.
ListViewWrappermethod),96UnCheck()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104uncheck()(pywinauto.
controls.
win32_controls.
ButtonWrappermethod),104uncheck_by_click()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104uncheck_by_click_input()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104UncheckByClick()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104UncheckByClickInput()(pywin-auto.
controls.
win32_controls.
ButtonWrappermethod),104unhook_keyboard()(pywinauto.
win32_hooks.
Hookmethod),76unhook_mouse()(pywinauto.
win32_hooks.
Hookmethod),76UniqueDict(classinpywinauto.
ndbestmatch),69UpDownWrapper(classinpywin-auto.
controls.
common_controls),103user_data()(pywinauto.
controls.
hwndwrapper.
HwndWrappermethod),86userdata()(inmodulepywinauto.
handleprops),131Vvalue()(pywinauto.
controls.
uia_controls.
SliderWrappermethod),115verify_actionable()(pywin-auto.
base_wrapper.
BaseWrappermethod),79verify_enabled()(pywinauto.
base_wrapper.
BaseWrappermethod),80verify_visible()(pywinauto.
base_wrapper.
BaseWrappermethod),80visible(pywinauto.
element_info.
ElementInfoattribute),126visible(pywinauto.
uia_element_info.
UIAElementInfoat-tribute),128visible(pywinauto.
win32_element_info.
HwndElementInfoattribute),127Wwait()(pywinauto.
application.
WindowSpecicationmethod),68wait_cpu_usage_lower()(pywin-auto.
application.
Applicationmethod),66WAIT_CRITERIA_MAP(pywin-auto.
application.
WindowSpecicationat-tribute),67wait_for_idle()(pywinauto.
base_wrapper.
BaseWrappermethod),80wait_for_idle()(pywin-auto.
controls.
hwndwrapper.
HwndWrappermethod),86Index157pywinautoDocumentation,Release0.
6.
8wait_for_process_exit()(pywin-auto.
application.
Applicationmethod),66wait_not()(pywinauto.
application.
WindowSpecicationmethod),68wait_until()(inmodulepywinauto.
timings),74wait_until_passes()(inmodulepywinauto.
timings),74was_maximized()(pywin-auto.
base_wrapper.
BaseWrappermethod),80wheel_click()(inmodulepywinauto.
mouse),63wheel_mouse_input()(pywin-auto.
base_wrapper.
BaseWrappermethod),80window()(pywinauto.
application.
Applicationmethod),66window()(pywinauto.
application.
WindowSpecicationmethod),69window_text()(pywinauto.
base_wrapper.
BaseWrappermethod),80window_text()(pywinauto.
controlproperties.
ControlPropsmethod),129WindowAmbiguousError,70windowclasses(pywinauto.
base_wrapper.
BaseWrapperattribute),80windowclasses(pywin-auto.
controls.
common_controls.
AnimationWrapperattribute),92windowclasses(pywin-auto.
controls.
common_controls.
CalendarWrapperattribute),93windowclasses(pywin-auto.
controls.
common_controls.
ComboBoxExWrapperattribute),93windowclasses(pywin-auto.
controls.
common_controls.
DateTimePickerWrapperattribute),94windowclasses(pywin-auto.
controls.
common_controls.
HeaderWrapperattribute),94windowclasses(pywin-auto.
controls.
common_controls.
HotkeyWrapperattribute),94windowclasses(pywin-auto.
controls.
common_controls.
IPAddressWrapperattribute),94windowclasses(pywin-auto.
controls.
common_controls.
ListViewWrapperattribute),96windowclasses(pywin-auto.
controls.
common_controls.
PagerWrapperattribute),96windowclasses(pywin-auto.
controls.
common_controls.
ProgressWrapperattribute),97windowclasses(pywin-auto.
controls.
common_controls.
ReBarWrapperattribute),97windowclasses(pywin-auto.
controls.
common_controls.
StatusBarWrapperattribute),98windowclasses(pywin-auto.
controls.
common_controls.
TabControlWrapperattribute),99windowclasses(pywin-auto.
controls.
common_controls.
ToolbarWrapperattribute),100windowclasses(pywin-auto.
controls.
common_controls.
ToolTipsWrapperattribute),99windowclasses(pywin-auto.
controls.
common_controls.
TrackbarWrapperattribute),101windowclasses(pywin-auto.
controls.
common_controls.
TreeViewWrapperattribute),103windowclasses(pywin-auto.
controls.
common_controls.
UpDownWrapperattribute),103windowclasses(pywin-auto.
controls.
win32_controls.
ButtonWrapperattribute),105windowclasses(pywin-auto.
controls.
win32_controls.
ComboBoxWrapperattribute),105windowclasses(pywin-auto.
controls.
win32_controls.
EditWrapperattribute),106windowclasses(pywin-auto.
controls.
win32_controls.
ListBoxWrapperattribute),107windowclasses(pywin-auto.
controls.
win32_controls.
PopupMenuWrapperattribute),107windowclasses(pywin-auto.
controls.
win32_controls.
StaticWrapperattribute),108WindowNotFoundError,70windows()(pywinauto.
application.
Applicationmethod),67WindowSpecication(classinpywinauto.
application),67WindowText()(pywinauto.
controlproperties.
ControlPropsmethod),129wm_get_ctrl_name(pywin-auto.
win32_element_info.
HwndElementInfoattribute),127wm_get_ctrl_type(pywin-auto.
win32_element_info.
HwndElementInfoattribute),127158IndexpywinautoDocumentation,Release0.
6.
8wrapper_class(pywinauto.
backend.
BackendsRegistryat-tribute),125wrapper_class()(inmodulepywinauto.
backend),125wrapper_object()(pywin-auto.
application.
WindowSpecicationmethod),69writable_props(pywinauto.
base_wrapper.
BaseWrapperattribute),80writable_props(pywin-auto.
controls.
common_controls.
ListViewWrapperattribute),96writable_props(pywin-auto.
controls.
common_controls.
ReBarWrapperattribute),97writable_props(pywin-auto.
controls.
common_controls.
StatusBarWrapperattribute),98writable_props(pywin-auto.
controls.
common_controls.
TabControlWrapperattribute),99writable_props(pywin-auto.
controls.
common_controls.
ToolbarWrapperattribute),100writable_props(pywin-auto.
controls.
common_controls.
TreeViewWrapperattribute),103writable_props(pywin-auto.
controls.
hwndwrapper.
HwndWrapperattribute),86writable_props(pywin-auto.
controls.
uia_controls.
EditWrapperat-tribute),113writable_props(pywin-auto.
controls.
uia_controls.
ListViewWrapperattribute),115writable_props(pywin-auto.
controls.
uia_controls.
ToolbarWrapperattribute),116writable_props(pywin-auto.
controls.
uia_controls.
TreeViewWrapperattribute),117writable_props(pywin-auto.
controls.
uiawrapper.
UIAWrapperat-tribute),111writable_props(pywin-auto.
controls.
win32_controls.
ComboBoxWrapperattribute),105writable_props(pywin-auto.
controls.
win32_controls.
EditWrapperattribute),106writable_props(pywin-auto.
controls.
win32_controls.
ListBoxWrapperattribute),107Write()(pywinauto.
remote_memory_block.
RemoteMemoryBlockmethod),133write_to_xml()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81WriteAppData()(pywinauto.
application.
Applicationmethod),65WriteDialogToFile()(inmodulepywinauto.
xml_helpers),131WriteToXML()(pywin-auto.
controls.
hwndwrapper.
DialogWrappermethod),81XXMLParsingError,131Index159

瓜云互联:全场9折优惠,香港CN2、洛杉矶GIA高防vps套餐,充值最高返300元

瓜云互联怎么样?瓜云互联之前商家使用的面板为WHMCS,目前商家已经正式更换到了魔方云的面板,瓜云互联商家主要提供中国香港和美国洛杉矶机房的套餐,香港采用CN2线路直连大陆,洛杉矶为高防vps套餐,三网回程CN2 GIA,提供超高的DDOS防御,瓜云互联商家承诺打死退款,目前商家提供了一个全场9折和充值的促销,有需要的朋友可以看看。点击进入:瓜云互联官方网站瓜云互联促销优惠:9折优惠码:联系在线客...

hosthatch:14个数据中心15美元/年

hosthatch在做美国独立日促销,可能你会说这操作是不是晚了一个月?对,为了准备资源等,他们拖延到现在才有空,这次是针对自己全球14个数据中心的VPS。提前示警:各个数据中心的网络没有一个是针对中国直连的,都会绕道而且ping值比较高,想买的考虑清楚再说!官方网站:https://hosthatch.com所有VPS都基于KVM虚拟,支持PayPal在内的多种付款方式!芝加哥(大硬盘)VPS5...

香港最便宜的vps要多少钱?最便宜的香港vps能用吗?

香港最便宜的vps要多少钱?最便宜的香港vps能用吗?香港vps无需备案,整体性能好,而且租用价格便宜,使用灵活,因为备受站长喜爱。无论是个人还是企业建站,都比较倾向于选择香港VPS。最便宜的香港vps能用吗?正因为有着诸多租用优势,香港VPS在业内颇受欢迎,租用需求量也在日益攀升。那么,对于新手用户来说,香港最便宜的vps租用有四大要点是务必要注意的,还有易探云香港vps租用最便宜的月付仅18元...

winrar5.0为你推荐
上海fastreport2University163程序微信5http://www.tutorialspoint.com/css/css_dimension.htmToolgraphcss3圆角如何用CSS实现圆角矩形?win7关闭445端口win7系统怎么关闭445和135这两个端口win10关闭445端口win10家庭版怎么禁用445端口win7还原系统电脑怎么恢复出厂设置win7旗舰版苹果5.1完美越狱苹果iPhone4 iOS5.1完美越狱教程是什么?
香港vps 免费申请网站域名 域名商 瓦工 windows主机 博客主机 mach rak机房 paypal认证 国外php空间 论坛空间 本网站服务器在美国 dux qingyun 共享主机 百度云1t 重庆双线服务器托管 789电视剧 最漂亮的qq空间 空间登录首页 更多