On Automating Windows Tasks

The past month I was assigned the task of automating the installation of a software package that uses msi files and then setup dialog windows.
Python (download_Python) has excelent libraries for this task:
Python Windows Automation

There is a great video that demonstrates the usage of the pywinauto: pywinauto_video

Follow the instructions in the page to download it (download_Pywinauto) and install it.
The above program will allow you to open and identify windows and control buttons using the application class, that can be found in the file application.py
Notice there that the combo boxes are controlled using its name. Internally the tool finds the window’s handle.
For some applications the window’s fields are hard to handle. This is because the fields don’t have unique names.
The way to handle this situation is to tab around the page until you land in the right field.
To this end download the Sendkeys tool, also in the page (download_Sendkeys). Make sure that you select the ‘Binaries’ download. Select the version that corresponds to the python version you have installed.
Once you have installed these two tools you can start controlling the windows and its contents.
Omar Flores

Advertisements

Tags: , ,

One Response to “On Automating Windows Tasks”

  1. James Daly Says:

    I loved the video that demonstrates the usage of the pywinauto. It was great info how to start playing with it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: