Latest release

Handling Privileges, AutomationID for Win32 etc.

@vasily-v-ryabov vasily-v-ryabov released this Jul 30, 2018 · 2 commits to master since this release


  • Check admin privileges for both target app and Python process. This
    allows detecting cases when window messages won't work.
  • Add automation_id and control_type properties
    for "win32" backend (the most useful for WinForms). Correct
    child_window() keywords are auto_id and control_type.
  • Switch pypiwin32 dependency to pywin32 which became official again.
  • New generators iter_children() and iter_descendants().
  • Add method is_checked() to "win32" check box.

Bug Fixes:

  • Method Application().connect(...) works better with timeout
  • 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.

@vasily-v-ryabov vasily-v-ryabov released this Jan 21, 2018 · 76 commits to master since this release

Bug Fixes

  • Final fix for 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")"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")

GitHub downloads

Better stability, usability and performance

@vasily-v-ryabov vasily-v-ryabov released this Jul 3, 2017 · 143 commits to master since this release

  • 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 for backend="uia". Thanks @maollm!
    • Methods 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!
  • 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 timeout Timings.app_connect_timeout.
    It can accept timeout and retry_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 in Application().start(...). Thanks @efremovd!
  • Class Application has been enriched with methods is_process_running() and wait_for_process_exit(). Thanks @efremovd!
  • Module 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!
  • 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 for backend="win32" with these methods: get_month_delta,
    set_month_delta and get_month_range. Thanks @Nikita-K!
  • Added method legacy_properties() to UIAWrapper. Thanks @AsyaPronina!
  • Improved VB6 ListView detection for backend="win32". Thanks @KirillMoizik!
  • Fixed 64-bit specific bug in TreeViewWrapper for backend="win32"
    (argument 4: <type 'exceptions.OverflowError'>: long int too long to convert).

GitHub downloads

More bug fixes

@vasily-v-ryabov vasily-v-ryabov released this Feb 28, 2017 · 287 commits to master since this release

  • 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.
  • Improved click methods behaviour for Win32 ListView and TreeView:
    ensure_visible() is called inside before the click.
  • Made taskbar.SystemTrayIcons localization friendly.

GitHub downloads

Bug fixes and optimizations for UI Automation and beyond

@vasily-v-ryabov vasily-v-ryabov released this Feb 8, 2017 · 318 commits to master since this release

  • 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 at import pywinauto.
    • Methods is_dialog() and restore() are missed for UIA backend.
    • Method print_control_identifiers() crashes on some applications with Unicode symbols.
    • Installation by python 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 or auto_id in
    a WindowSpecification. Method Application.kill() is also optimized in many cases.
  • Added an example for Win10 Calculator.

GitHub downloads

MS UI Automation support, PEP-8 compliance, Win32 hooks and more

@vasily-v-ryabov vasily-v-ryabov released this Oct 31, 2016 · 409 commits to master since this release

  • 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 through comtypes (like UiaComWrapper for .NET but in CPython).
    • Despite code coverage is ~95% consider it as beta quality. Performance is slower than for "win32".
  • Documentation is built continuously now on ReadTheDocs. See also improved
    Getting Started Guide.
  • Modules keyboard and mouse 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 from 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.
  • Code style is much closer to PEP8: i.e. click_input should be used
    instead of ClickInput.
  • 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 the win32_hooks module is
    used in pyhooked 0.8 by Ethan Smith.
  • A lot of small improvements are not counted here.

GitHub downloads

Bug fixes and partial MFC Menu Bar support

@vasily-v-ryabov vasily-v-ryabov released this Oct 30, 2015 · 1195 commits to master since this release

  • Fix bugs and inconsistencies:
    • Add where="check" possible value to the ListViewWrapper.Click/ClickInput` methods.
    • Add CheckByClickInput and UncheckByClickInput methods for a plain check box.
    • Fix crash while waiting for the window start.
  • 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 the ToolbarWrapper.
  • Python 3.5 is supported.

GitHub downloads

Better Unicode support for SetEditText/TypeKeys and menu items

@vasily-v-ryabov vasily-v-ryabov released this Sep 25, 2015 · 1264 commits to master since this release

  • Better backward compatibility with pywinauto 0.4.2:
    • support Unicode symbols in the TypeKeys method again;
    • allow SetEditText/TypeKeys methods to take non-string arguments;
    • fix taking Unicode parameters in SetEditText/TypeKeys.
  • Fix bug in Wait("active"), raise a SyntaxError when waiting for an incorrect state.
  • Re-consider some timings, update docs for the default values etc.
  • Fix several issues with an owner-drawn menu.
  • MenuItem method Click is renamed to ClickInput while Click = Select now.
  • New SetTransparency method can make a window transparent in a specified degree (from 0 to 255).
  • New window search criteria found_index is useful to choose the control in the list of similar ones with same texts.

GitHub downloads

Improve ListView, new methods for CPU usage, DPI awareness

@vasily-v-ryabov vasily-v-ryabov released this Sep 8, 2015 · 1358 commits to master since this release

  • New Application methods: CPUUsage returns CPU usage as a percent (float number),
    WaitCPUUsageLower waits until the connected process' CPU usage is lower than
    specified value (2.5% by default).
  • ListViewWrapper interface is aligned with TreeViewWrapper. GetItem() returns a _listview_item object that looks like a _treeview_element now.
  • Add DPI awareness API support (Win8+). It allows correct work when all fonts
    are scaled at 125%, 150% etc (globally or per monitor).
  • "Waiting for Long Operations" section in docs.
  • Fix number of bugs:
    • TreeViewWrapper.Select doesn't work when the control is not in focus.
    • TabControlWrapper.Select doesn't work in case of TCS_BUTTONS style set.
    • ListViewWrapper methods Check/UnCheck are fixed.
    • Toolbar button: incorrect access by a tooltip text.
    • Warning "Cannot retrieve text length for handle" uses print() instead of actionlogger.
    • ClientToScreen method doesn't return a value (modifying mutable argument is not good practice).

GitHub downloads

Several fixes, more tests

@vasily-v-ryabov vasily-v-ryabov released this Jul 13, 2015 · 1415 commits to master since this release

  • Resolve pip issues
  • Warnings about mismatched Python/application bitness
  • Add "TCheckBox" class name to ButtonWrapper detection list
  • Fix DebugMessage method
  • Disable logging ( by default, provide shortcuts: actionlogger.enable() and actionlogger.disable().
    For those who are familiar with standard logging module there's method actionlogger.set_level(level).

GitHub downloads