Releases: pywinauto/pywinauto
Releases · pywinauto/pywinauto
Minor Enhancements and Fixes
Enhancements
- Add
allow_magic_lookup
flag for Application and Desktop object. Thanks @pakal! - Don't duplicate already pressed key in internal list in
win32_hooks.py
. Thanks @TomRobo237! - Allow finding an edit box by title (its editable text).
- Add option to send keyboard input for an application which doesn't handle VK_PACKET properly.
Usevk_packet=False
in methodtype_keys
, default value isvk_packet=True
. Thanks @philmbailey!
Bug Fixes
- Fix ctypes.windll usage conflicts with other libraries.
- Minor fixes in top-level
__init__.py
. Thanks @pakal! - Fix logging issues in
remote_memory_block.py
. Thanks @TomRobo237! - Minor docs improvements. Thanks @olesteban, @caoyaxing221 and @nuno-andre!
Bug Fixes
Enhancements
- Reuse
ctypes.wintypes
more to avoid redundant definitions for Win32 API. - Add method
EditWrapper.is_editable()
for "uia" backend.
Bug Fixes
- Fix corner case with int/long conversion crash while getting text.
- Fix UIA crash: handle
InvalidControlType
properly. - Fix
menu_select()
for one level main menu in WinForms apps. - Make
Application
object non-iterable (iterating was hang). - Fix type conversion crash in
GetWindowRect
(method.rectangle()
). - Fix combo box fluttering/blinking in
dump_tree() / print_control_identifiers()
.
Better WinForms/Qt5 Support
Enhancements
- Improve support for WinForms and Qt5: ComboBox, ListBox, DataGrid/Table.
- Add an ability to use MFC toolbar buttons by text. Thanks @Nebyt !
- Make method
kill()
hard (and fast) by default (can be used with paramsoft=True
optionally). - Make
visible_only=False
a default option for methodconnect()
(useful for minimized apps). - Add an ability to hold or release a key with params
down
andup
for.type_keys()
method. See the improved docs for keyboard module for more details. Thanks @badari412 ! - Add method
windows()
to classDesktop
. - Add Remote Execution Guide with all known RDP/VNC/psexec/etc tricks.
Bug Fixes
- Fix
UnicodeDecodeError/UnicodeEncodeError
in several cases
while printing wrapper object representation. - Add static text to a list of best match names for
backend="uia"
. - Fix
COMError
forruntime_id
property. - Fix method
click()
for some radio buttons. - Improve error message when screen is locked.
- Use
utf-8
encoding while writingdump_tree()
output to file. - Remove few incorrect warnings for
backend="win32"
. - Fix crash in
GetWindowRect
call. - Fix black screenshot issue with second monitor. Thanks @Nebyt !
Handling Privileges, AutomationID for Win32 etc.
Enhancements:
- Check admin privileges for both target app and Python process. This
allows detecting cases when window messages won't work. - Add
automation_id
andcontrol_type
properties
for "win32" backend (the most useful for WinForms). Correct
child_window() keywords areauto_id
andcontrol_type
. - Switch pypiwin32 dependency to pywin32 which became official again.
- New generators
iter_children()
anditer_descendants()
. - Add method
is_checked()
to "win32" check box.
Bug Fixes:
- Method
Application().connect(...)
works better withtimeout
argument. - Fix
.set_focus()
for "uia" backend including minimized window case
(issue #443). maximize()/minimize()
methods can be chained now.- Fix passing keyword arguments to a function for decorators
@always_wait_until_passes
and@always_wait_until
. - Use correct types conversion for WaitGuiThreadIdle (issue #497).
- Fix reporting code coverage on Linux.
- Use
.format()
for logging BaseWrapper actions (issue #471). - Print warning in case binary type is not determined (issue #387).
UIA crash fix, multi-threading mode etc.
Bug Fixes
- Final fix for
ValueError: NULL COM pointer access
(UIA backend).
Enhancements
-
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")
Better stability, usability and performance
- Improved string representation for all wrapper objects. Thanks @airelil!
- Fixed several sporadic crashes for
backend="uia"
. - Fixed several bugs in
wait/wait_not
methods:- Method
wait('exists')
doesn't work forbackend="uia"
. Thanks @maollm! - Methods
wait/wait_not
take ~ default time (5 sec.) instead of customized timeout like 1 sec.
- Method
depth
param can used in aWindowSpecification
now.depth=1
means this control,
depth=2
means immediate children only and so on (aligned withprint_control_identifiers
method). Thanks @dmitrykazanbaev!- Significantly improved sending keys to an inactive window silently. Special thanks for @antonlarin! Now 2 methods are available:
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).
- Method
Application().connect(path='your.exe')
uses default timeoutTimings.app_connect_timeout
.
It can accepttimeout
andretry_interval
keyword arguments. Thanks @daniil-kukushkin! - Method
print_control_identifiers
is more consistent and minimum 2x faster now! Thanks @cetygamer! - Fixed subclassing
Application
with your own methods. Thanks @efremovd! - Param
work_dir
can be used inApplication().start(...)
. Thanks @efremovd! - Class
Application
has been enriched with methodsis_process_running()
andwait_for_process_exit()
. Thanks @efremovd! - Module
timings
usestime.clock()
for Python 2.x andtime.perf_counter()
for Python 3.x
so that accident system time change can't affect on your script behavior. Thanks @airelil! - Added WireShark example. Thanks @ViktorRoy94!
- Now
print_control_identifiers()
can dump UI elements tree to a file. Thanks @sovrasov! - Improved logging actions for
backend="uia"
, extended example for MS Paint. Thanks @ArtemSkrebkov! - Extended
CalendarWrapper
forbackend="win32"
with these methods:get_month_delta
,
set_month_delta
andget_month_range
. Thanks @Nikita-K! - Added method
legacy_properties()
toUIAWrapper
. Thanks @AsyaPronina! - Improved VB6 ListView detection for
backend="win32"
. Thanks @KirillMoizik! - Fixed 64-bit specific bug in
TreeViewWrapper
forbackend="win32"
(argument 4: <type 'exceptions.OverflowError'>: long int too long to convert
).
More bug fixes
- Several bugs were fixed:
- Maximized window is always resized (restored) when calling
set_focus()
. - AttributeError: type object '_CustomLogger' has no attribute 'disable'.
print_control_identifiers()
gets bytes string on Python 3.x.- Importing pywinauto causes debug messages to appear twice.
- Maximized window is always resized (restored) when calling
- Improved click methods behaviour for Win32 ListView and TreeView:
ensure_visible()
is called inside before the click. - Made
taskbar.SystemTrayIcons
localization friendly.
Bug fixes and optimizations for UI Automation and beyond
win32_hooks
module is well tested and more reliable now. See detailed example.- Fixed several bugs and crashes here and there.
- Crash when ctrl.window_text() becomes None at the right moment. Thanks @mborus!
HwndWrapper.set_focus()
fails when used via interpreter. Thanks @mtkennerly!- Fix LoadLibrary call error on just released Python 2.7.13. Thanks @KirillMoizik!
- AttributeError: WindowSpecification class has no 'CPUUsage' method.
comtypes
prints a lot of warnings atimport pywinauto
.- Methods
is_dialog()
andrestore()
are missed for UIA backend. - Method
print_control_identifiers()
crashes on some applications with Unicode symbols. - Installation by
python setup.py install
may fail if pyWin32 dependency was installed manually. - Bug in resolving attributes: 'UIAWrapper' object has no attribute 'Menu' for
dlg = app.Custom.Menu
. - Method
send_chars()
can now send{ENTER}
to some applications. Thanks @batterseapower!
- Searching UI elements is faster now especially if you use
control_type
orauto_id
in
a WindowSpecification. MethodApplication.kill()
is also optimized in many cases. - Added an example for Win10 Calculator.
MS UI Automation support, PEP-8 compliance, Win32 hooks and more
- This big release introduces MS UI Automation (UIA) support (beta). Feedback is very welcome!
- Just start from
app = Application(backend='uia').start('your_app.exe')
. - Default backend is still
'win32'
if nothing is specified. - Supported WPF controls: Menu, Button/CheckBox/RadioButton, ComboBox, Edit,
Tab control, List (ListView), DataGrid, Tree, Toolbar, Tooltip, Slider. - It uses native
UIAutomationCore.dll
throughcomtypes
(like UiaComWrapper for .NET but in CPython). - Despite code coverage is ~95% consider it as beta quality. Performance is slower than for "win32".
- Just start from
- Documentation is built continuously now on ReadTheDocs. See also improved
Getting Started Guide. - Modules
keyboard
andmouse
can be used out of any window context now. And they work on Linux as well! - New multi-backend architecture makes implementation of new platforms support
easier in the future. The minimal set for new backend includes its name and
two classes inherited fromElementInfo
and fromBaseWrapper
. New backend
must be registered by functionbackend.register()
. Linux AT SPI and Apple Accessibility API are in the long term plans. - Code style is much closer to PEP8: i.e.
click_input
should be used
instead ofClickInput
. - Initial implementation of the
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 thewin32_hooks
module is
used in pyhooked 0.8 by Ethan Smith. - A lot of small improvements are not counted here.
Bug fixes and partial MFC Menu Bar support
- Fix bugs and inconsistencies:
- Add
where="check"
possible value to the ListViewWrapper.Click/ClickInput` methods. - Add
CheckByClickInput
andUncheckByClickInput
methods for a plain check box. - Fix crash while waiting for the window start.
- Add
- Add partial MFC Menu Bar support. The menu bar can be interpreted as a toolbar. Items are clickable by index through experimental
MenuBarClickInput
method of theToolbarWrapper
. - Python 3.5 is supported.