pywinauto 0.2.1 released - lots of new functionality
Mark Mc Mahon
mark.m.mcmahon at gmail.com
Sun Feb 19 04:26:29 CET 2006
The 0.2.1 release of pywinauto is now available.
pywinauto is a set of open-source (LGPL) modules for using Python as a GUI
automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP).
SourceForge project page:
Download from SourceForge
Here is the list of changes:
0.2.1 Small Release number - big changes
* Quick release to get many changes out there - but this release has
been less tested then I would like for a 0.3.0 release.
* Allow access to non text controls using the closest Text control.
This closest text control will normally be the static/label associated
with the control. For example in Notepad, Format->Font dialog, the 1st
combobox can be refered to as "FontComboBox" rather than "ComboBox1"
* Added a new control wrapper - ``PopupMenuWrapper`` for context menu's
You can now work easily with context menu's
# need to use MenuClick rather then MenuSelect
I could think of merging the ``RightClick()`` and ``MenuSelect()``
into one method ``ContextMenuSelect()`` if that makes sense to most
* Added Support for Up-Down controls
* Not all top level windows now have a FriendlyClassName of "Dialog".
I changed this because it made it hard to get windows of a particular
class. For example the main Notepad window has a class name of "Notepad".
This was primarily implemented due to work I did getting the System Tray.
* Renamed ``StatusBarWrapper.PartWidths()`` to ``PartRightEdges()`` as this
is more correct for what it returns.
* Changed HwndWrapper.Text() and SetText() to WindowText() and
SetWindowText() respectively to try and make it clearer that it is
the text returned by GetWindowText and not the text that is visible
on the control. This change also suggested that EditWrapper.SetText()
be changed to SetEditText() (though this is not a hard requirement
EditWrapper.SetText() still exists - but may be deprecated.
* Added ClickInput, DoubleClickInput, RightClickInput, PressMouseInput
ReleaseMouseInput to HwndWrapper - these use SendInput rather then
WM_LBUTTONDOWN, WM_RBUTTONUP, etc used by Click, DoubleClick etc.
I also added a MenuClick method that allows you to click on menu
items. This means you can now 'physically' drop menus down.
* Some further working with tooltips that need to be cleaned up.
* Fixed a bug where coordinates passed to any of the Click operations had
the X and Y coordinates swapped.
* Added new MenuItem and Menu classes that are to the most part hidden
but you can get a menu item by doing ::
MenuItems have various actions so for example you can use
``MenuItem.IsChecked()`` to check if the menu item is checked.
Among other methods there are ``Click()`` and ``Enabled()``.
* Modified the 'best match' algorithm for finding controls.
It now searches a couple of times, and tries to find the best
fit for the text passed to it. The idea here is to make it more
"Select what I want - not that other thing that looks a bit like
what I want!". It is possible this change could mean you need to
use new identifiers in scripts - but in general very little modification
should be necessary.
There was also a change to the algorithm that looked for the closest
text control. It missed some obvious controls in the previous
implementation. It also had a bug for controls above the control
rather than to the left.
* Added a new example scripts SaveFromInternetExplorer.py and
SaveFromFirefox.py which show automating downloading of a page
from either of these browsers.
* Added yet more unit tests, there are now a total of 134 tests.
If you want to follow this project then please sign up to the mailing list:
Mark Mc Mahon
Manchester, NH 03110, USA
<P><A HREF="http://sourceforge.net/projects/pywinauto">pywinauto 0.2.1</A>
Simple Windows GUI automation with Python. (17-Feb-06)
More information about the Python-announce-list