Skip to content

Commit

Permalink
Initial clone of pywinauto 0.4.2 (32-bit).
Browse files Browse the repository at this point in the history
  • Loading branch information
vasily-v-ryabov committed Nov 19, 2014
1 parent 8667d83 commit e5842c7
Show file tree
Hide file tree
Showing 246 changed files with 63,611 additions and 0 deletions.
167 changes: 167 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include Readme.txt
include dev_notes.txt
include HISTORY.TXT
include LICENSE.txt
include TODO.txt
include setup.cfg
include setup.py


include pywinauto
include pywinauto\controls\*.py
include pywinauto\tests\*.py
include pywinauto\unittests\*.py
exclude pywinauto\.svn\*

# include the examples - but not Watsup or .svn directories
include pywinauto\examples\*.pkl
include examples\*.py
include examples\*.txt
exclude examples\.svn\README.txt
exclude examples\examples_watsup\*.*

# include all the website folder and make sure that
# the sub version files are not included
include docs\*.*
exclude docs\.svn\*
exclude docs\pywinauto\.svn\*
exclude docs\pywinauto\controls\.svn\*
exclude docs\pywinauto\tests\.svn\*
exclude docs\.doctrees\*
36 changes: 36 additions & 0 deletions MakeBackup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@echo off
if (%1)==() goto VersionNotGiven

md previousReleases\%1

if not exist previousReleases\%1 goto FolderNotCreated

md previousReleases\%1\DlgCheck2
if not exist previousReleases\%1 goto FolderTwoNotCreated

copy *.py previousReleases\%1
copy dlgCheck2 previousReleases\%1\DlgCheck2


goto finished

:FolderNotCreated
echo.
echo Could not create the folder "previousReleases\%1"
echo.
goto finished

:FolderTwoNotCreated
echo.
echo Could not create the folder "previousReleases\%1\DlgCheck2"
echo.
goto finished


VersionNotGiven
echo.
echo please specify the version of the backup
echo.
goto finished

:finished
87 changes: 87 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
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
Loading

0 comments on commit e5842c7

Please sign in to comment.