Sunday, November 1, 2015

New Code Generator in SWAPY

Pywinauto is a great tool for those who have some experience in Python. But what is about the beginners or those who are not yet familiar with Python and/or GUI automation?

SWAPY is a GUI helper for objects hierarchy inspection. Generally it looks like similar tools from Microsoft (Spy++, Inspect.exe), but it's designed specifically for Pywinauto users. It's especially helpful for getting started with Pywinauto library.

SWAPY can recognize every control that is visible to Pywinauto. So you may check quickly whether Pywinauto is suitable for your application. If this is the case, SWAPY can help with prototyping your automation scripts using the Code Generator feature.

The Code Generator is significantly renovated in the SWAPY 0.4.8.

How does it work? Just start looking for the controls hierarchy. If you want to do some action, right click on the control item in the tree and choose a method to call.



Code Generator automatically inserts the code into the Editor pane. The action is also performed simultaneously in the application. All the generated code can be saved to *.py file.

Monday, October 26, 2015

Pywinauto Has Been Presented at the Auckland Python Meetup

The regular Auckland Python Meetup has been held on 23 October where Valentin (airelil) presented the project. Unfortunately video wasn't recorded this time. However the slides are still available for everyone. A small insight into Pywinauto internals describing principles of controls name resolution and introductory examples can make your automation scripting a bit easier.

One of the quite popular (strangely) questions, that popped out on the presentation too, is "How can I interact with a console window of cmd.exe?". In this case, Pywinauto couldn't be the answer though. We believe that a GUI automation tool should be used for GUI not a command line. :)

The standard way to send keyboard input to the console application is using subprocess.Popen() object with stdin=subprocess.PIPE and stdout=subprocess.PIPE arguments that are well described in the Python docs.

Interestingly, a person on Stack Overflow discovered that it's possible to send characters to cmd.exe using WM_CHAR window message. It even works silently for a minimized console window. That is could be considered as an alternative for the TypeKeys method in Pywinauto which runs for the active window only. However you have to remember that TypeKeys performs a closer real user behavior emulation than sending of WM_CHAR message or calling SetText for a GUI control.

Thursday, October 15, 2015

New Team Icon and New Team Members

The Open Source community (pywinauto & SWAPY) has a new team icon. It's name is cat Walter. Thanks Anna who painted it.

Welcome 2 new members in the project! Ivan and Alexander are students at Lobachevsky State University of Nizhny Novgorod (UNN) making their diploma works at the Computer Science department.

Monday, October 12, 2015

Pywinauto Has Been Revived This Summer!

Pywinauto is a great Python solution for Windows GUI Automation. It has been intensively developed from 2006 up to 2011 by Mark McMahon. In period 2011-2013 it was maintained by Michael Herrmann (version 0.4.2).

Google Code, the original hosting of Pywinauto, recently has been declared as end-of-life so the revived project is now hosted on GitHub. The first new major version 0.5.0, released on June, 30th was featured with a full support to x64 for Python 2 / Python 3 and several other improvements as well.

The latest pywinauto, version 0.5.3, focused on restoring the partially broken backward compatibility with 0.4.2. The full list of changes can be found here.
These new releases are maintained by Intel Corporation (c) and the Open Source community.

Many thanks to the contributors who helped to make it possible: airelil and moden-py (author of SWAPY, the Pywinauto object inspector).