Latest release

UIA crash fix, multi-threading mode etc.

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

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")

GitHub downloads

Better stability, usability and performance

@vasily-v-ryabov vasily-v-ryabov released this Jul 3, 2017 · 122 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 · 266 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 · 297 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 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 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 · 388 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 · 1174 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 · 1243 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 · 1337 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 · 1394 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 (actionlogger.py) 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

64-bit Py2/Py3 compatibility

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

  • 64-bit Python and 64-bit apps support (but 32-bit Python is recommended for 32-bit apps)
  • Python 2.x/3.x compatibility
  • [!] Added pyWin32 dependency (silent install by pip for 2.7 and 3.1+)
  • Improvements for Toolbar, TreeView, UpDown and DateTimePicker wrappers
  • Improved best_match algorithm allows names like ToolbarFile
  • Clicks can be performed with pressed Ctrl or Shift
  • Drag-n-drop and scrolling methods (DragMouse, DragMouseInput, MouseWheelInput)
  • Improved menu support: handling OWNERDRAW menu items; access by command_id (like $23453)
  • Resolved issues with py2exe and cx_freeze
  • RemoteMemoryBlock can now detect memory corruption by checking guard signature
  • Upgraded taskbar module
  • sysinfo module for checking 32-bit or 64-bit OS and Python
  • set_foreground flag in TypeKeys method for typing into in-place controls
  • flags create_new_console and wait_for_idle in Application.start method

GitHub downloads