Automatically exported from code.google.com/p/pywinauto
Go to file
2013-09-16 11:42:58 +02:00
doc_src Update the documentation on dependencies (python 2.3 and 2.4 are quite old, and SendKeysCtypes is included in Pywinauto) 2011-01-28 16:30:12 +08:00
examples * Updated these brittle example scripts 2009-11-21 14:24:50 +00:00
pywinauto Updated version number to 0.4.2 and re-generated the documentation. 2013-09-16 11:38:49 +02:00
sandbox Adding some files I am working on. 2006-11-30 00:01:47 +00:00
.hgignore ignore some of the test support/output files 2010-12-20 18:22:45 +09:00
LICENSE.txt ... 2006-01-20 23:15:26 +00:00
MakeBackup.bat made a copy 2006-01-04 21:21:00 +00:00
makedocs.bat Fix the path to build_autodoc_files.py and call it by default everytime (it is safe as it does not re-generate files which already exist) 2010-12-19 17:52:10 +09:00
MANIFEST.in * Exclude the .doctrees folder from the source zip 2009-03-15 19:33:03 +00:00
Readme.txt ... 2006-03-06 21:59:45 +00:00
setup.cfg Don't need/want to force manifest anymore 2006-02-07 00:04:44 +00:00
setup.py Strip trailing whitespace 2010-12-20 17:46:04 +09:00

pywinauto 
(c) Mark Mc Mahon 2006 
Released under the LGPL licence


What is it
----------
pywinauto is a set of python modules to automate the Microsoft Windows GUI. 
At it's simplest it allows you to send mouse and keyboard actions to windows 
dialogs and controls.


Installation
------------

Unzip the pywinauto zip file to a folder.
Install the following Python packages
ctypes       http://starship.python.net/crew/theller/ctypes/
Sendkeys     http://www.rutherfurd.net/python/sendkeys/index.html
(Optional) PIL          http://www.pythonware.com/products/pil/index.htm
(Optional) elementtree  http://effbot.org/downloads/

To check you have it installed correctly
run Python
>>> import application
>>> app = application.Application().start_("notepad")
>>> app.notepad.TypeKeys("%FX") 


Where to start
--------------
Look at the examples provided in test_application.py
There are examples in there to work with Notepad and MSPaint.

Note: These examples currently only work on English.


How does it work
----------------
A lot is done through attribute access (__getattr__) for each class. For example
when you get the attribute of an Application or Dialog object it looks for a 
dialog or control (respectively).

myapp.Notepad # looks for a Window/Dialog of your app that has a title 'similar'
              # to "Notepad"
              
myapp.PageSetup.OK # looks first for a dialog with a title like "PageSetup"
                   # then it looks for a control on that dialog with a title
                   # like "OK"
                   
This attribute resolution is delayed (currently a hard coded amount of time) until
it succeeds. So for example if you Select a menu option and then look for the
resulting dialog e.g.
app.Notepad.MenuSelect("File->SaveAs")
app.SaveAs.ComboBox5.Select("UTF-8")
app.SaveAs.edit1.SetText("Example-utf8.txt")
app.SaveAs.Save.Click()

At the 2nd line the SaveAs dialog might not be open by the time this line is
executed. So what happens is that we wait until we have a control to resolve 
before resolving the dialog. At that point if we can't find a SaveAs dialog with
a ComboBox5 control then we wait a very short period of time and try again, 
this is repeated up to a maximum time (currently 1 second!)

This avoid the user having to use time.sleep or a "WaitForDialog" function.


Some similar tools for comparison
---------------------------------
 * Python tools
    - Watsup
    - winGuiAuto

 * Other scripting language tools
    - Perl Win32::GuiTest
    - Ruby GuiTest
    - others?

 * Other free tools
    - AutoIt
    - See collection at: 

 * Commercial tools
    - WinRunner
    - SilkTest
    - Visual Test
    - Many Others