Windows GUI Automation with Python (based on text properties)
allow_magic_lookup
flag for Application and Desktop object. Thanks @pakal!win32_hooks.py
. Thanks @TomRobo237!vk_packet=False
in method type_keys
, default value is vk_packet=True
. Thanks @philmbailey!__init__.py
. Thanks @pakal!remote_memory_block.py
. Thanks @TomRobo237!ctypes.wintypes
more to avoid redundant definitions for Win32 API.EditWrapper.is_editable()
for "uia" backend.InvalidControlType
properly.menu_select()
for one level main menu in WinForms apps.Application
object non-iterable (iterating was hang).GetWindowRect
(method .rectangle()
).dump_tree() / print_control_identifiers()
.kill()
hard (and fast) by default (can be used with param soft=True
optionally).visible_only=False
a default option for method connect()
(useful for minimized apps).down
and up
for .type_keys()
method. See the improved docs for keyboard module for more details. Thanks @badari412 !windows()
to class Desktop
.UnicodeDecodeError/UnicodeEncodeError
in several cases
while printing wrapper object representation.backend="uia"
.COMError
for runtime_id
property.click()
for some radio buttons.utf-8
encoding while writing dump_tree()
output to file.backend="win32"
.GetWindowRect
call.automation_id
and control_type
properties
for "win32" backend (the most useful for WinForms). Correct
child_window() keywords are auto_id
and control_type
.iter_children()
and iter_descendants()
.is_checked()
to "win32" check box.Application().connect(...)
works better with timeout
argument..set_focus()
for "uia" backend including minimized window case
(issue #443).maximize()/minimize()
methods can be chained now.@always_wait_until_passes
and @always_wait_until
..format()
for logging BaseWrapper actions (issue #471).ValueError: NULL COM pointer access
(UIA backend).Multi-threading mode (MTA) for comtypes is enabled by default, if it's not initialized by another library before importing pywinauto.
Method get_value()
has been added to EditWrapper in UIA backend.
Method scroll()
has been added for all UIA controls which have ScrollPattern implemented.
Added methods is_minimized/is_maximized/is_normal/get_show_state
for UIAWrapper.
Added handling in-place controls inside ListView control and (row, column) indexing in a grid-like table mode. Examples:
auto_detected_ctrl = list_view.get_item(0).inplace_control()
combo = list_view.get_item(1,1).inplace_control("ComboBox")
combo.select("Item name")
edit = list_view.get_item(3,4).inplace_control("Edit")
edit.type_keys("some text{ENTER}", set_foreground=False)
dt_picker = list_view.get_item(2,0).inplace_control("DateTimePicker")
backend="uia"
.wait/wait_not
methods:
wait('exists')
doesn't work for backend="uia"
. Thanks @maollm!wait/wait_not
take ~ default time (5 sec.) instead of customized timeout like 1 sec.depth
param can used in a WindowSpecification
now. depth=1
means this control,
depth=2
means immediate children only and so on (aligned with print_control_identifiers
method). Thanks @dmitrykazanbaev!send_chars
is supposed to send character input (this includes {Enter}
, {Tab}
, {Backspace}
) without Alt/Shift/Ctrl modifiers.send_keystrokes
is for key input (including key combinations with Alt/Shift/Ctrl modifiers).Application().connect(path='your.exe')
uses default timeout Timings.app_connect_timeout
.
It can accept timeout
and retry_interval
keyword arguments. Thanks @daniil-kukushkin!print_control_identifiers
is more consistent and minimum 2x faster now! Thanks @cetygamer!Application
with your own methods. Thanks @efremovd!work_dir
can be used in Application().start(...)
. Thanks @efremovd!Application
has been enriched with methods is_process_running()
and wait_for_process_exit()
. Thanks @efremovd!timings
uses time.clock()
for Python 2.x and time.perf_counter()
for Python 3.x
so that accident system time change can't affect on your script behavior. Thanks @airelil!print_control_identifiers()
can dump UI elements tree to a file. Thanks @sovrasov!backend="uia"
, extended example for MS Paint. Thanks @ArtemSkrebkov!CalendarWrapper
for backend="win32"
with these methods: get_month_delta
,
set_month_delta
and get_month_range
. Thanks @Nikita-K!legacy_properties()
to UIAWrapper
. Thanks @AsyaPronina!backend="win32"
. Thanks @KirillMoizik!TreeViewWrapper
for backend="win32"
(argument 4: <type 'exceptions.OverflowError'>: long int too long to convert
).set_focus()
.print_control_identifiers()
gets bytes string on Python 3.x.ensure_visible()
is called inside before the click.taskbar.SystemTrayIcons
localization friendly.win32_hooks
module is well tested and more reliable now. See detailed example.HwndWrapper.set_focus()
fails when used via interpreter. Thanks @mtkennerly!comtypes
prints a lot of warnings at import pywinauto
.is_dialog()
and restore()
are missed for UIA backend.print_control_identifiers()
crashes on some applications with Unicode symbols.python setup.py install
may fail if pyWin32 dependency was installed manually.dlg = app.Custom.Menu
.send_chars()
can now send {ENTER}
to some applications. Thanks @batterseapower!control_type
or auto_id
in
a WindowSpecification. Method Application.kill()
is also optimized in many cases.app = Application(backend='uia').start('your_app.exe')
.'win32'
if nothing is specified.UIAutomationCore.dll
through comtypes
(like UiaComWrapper for .NET but in CPython).keyboard
and mouse
can be used out of any window context now. And they work on Linux as well!ElementInfo
and from BaseWrapper
. New backend
must be registered by function backend.register()
. Linux AT SPI and Apple Accessibility API are in the long term plans.click_input
should be used
instead of ClickInput
.win32_hooks
module. Keyboard and mouse event
handlers can be registered in the system. It was inspired by pyHook, pyhk,
pyhooked and similar modules, but re-written from scratch. Thanks for
Max Samokhvalov! The fork (at some moment) of the win32_hooks
module is
used in pyhooked 0.8 by Ethan Smith.where="check"
possible value to the ListViewWrapper.Click/ClickInput` methods.CheckByClickInput
and UncheckByClickInput
methods for a plain check box.MenuBarClickInput
method of the ToolbarWrapper
.