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
没有合适的资源?快使用搜索试试~ 我知道了~
Python Windows Automation script component for QA
共213个文件
html:143个
py:58个
txt:5个
4星 · 超过85%的资源 需积分: 9 18 下载量 107 浏览量
2009-02-21
22:12:55
上传
评论
收藏 868KB ZIP 举报
温馨提示
使python能更好的用于windows产品的自动化测试。特别可以用于C/S结构的产品。
资源推荐
资源详情
资源评论
收起资源包目录
Python Windows Automation script component for QA (213个子文件)
setup.cfg 31B
rst.css 6KB
site.css 4KB
layout.css 2KB
pudge.css 1KB
common_controls.py.html 538KB
HwndWrapper.py.html 360KB
application.py.html 309KB
win32_controls.py.html 172KB
module-pywinauto.controls-index.html 114KB
menuwrapper.py.html 113KB
XMLHelpers.py.html 111KB
findbestmatch.py.html 111KB
truncation.py.html 109KB
timings.py.html 74KB
handleprops.py.html 67KB
findwindows.py.html 58KB
module-pywinauto.controls.common_controls-index.html 57KB
class-pywinauto.controls.HwndWrapper.HwndWrapper.html 53KB
repeatedhotkey.py.html 52KB
overlapping.py.html 43KB
missingextrastring.py.html 36KB
module-pywinauto.controls.HwndWrapper-index.html 31KB
translation.py.html 30KB
license.html 29KB
asianhotkey.py.html 28KB
missalignment.py.html 27KB
history.html 27KB
__init__.py.html 26KB
miscvalues.py.html 26KB
module-pywinauto.controls.win32_controls-index.html 26KB
leadtrailspaces.py.html 26KB
clipboard.py.html 25KB
controls_overview.html 25KB
wraphandle.py.html 25KB
_menux.py.html 24KB
comparetoreffont.py.html 23KB
howto.html 22KB
module-pywinauto.controls.common_controls.html 20KB
taskbar.py.html 19KB
module-pywinauto.tests-index.html 18KB
module-pywinauto.application-index.html 17KB
class-pywinauto.controls.common_controls.ListViewWrapper.html 17KB
class-pywinauto.application.Application.html 16KB
comboboxdroppedheight.py.html 15KB
module-pywinauto.handleprops.html 15KB
class-pywinauto.application.WindowSpecification.html 14KB
__init__.py.html 14KB
class-pywinauto.controls.common_controls.BandWrapper.html 13KB
allcontrols.py.html 12KB
class-pywinauto.controls.win32_controls.EditWrapper.html 12KB
module-pywinauto.application.html 12KB
class-pywinauto.controls.menuwrapper.MenuItem.html 12KB
class-pywinauto.findbestmatch.UniqueDict.html 11KB
class-pywinauto.controls.common_controls.TabControlWrapper.html 11KB
module-pywinauto.controls.menuwrapper-index.html 11KB
class-pywinauto.controls.common_controls.TreeViewWrapper.html 11KB
module-pywinauto.timings.html 11KB
module-pywinauto.findbestmatch.html 11KB
class-pywinauto.controls.win32_controls.ComboBoxWrapper.html 11KB
class-pywinauto.controls.win32_controls.ListBoxWrapper.html 11KB
class-pywinauto.controls.win32_controls.ButtonWrapper.html 10KB
class-pywinauto.controls.common_controls.StatusBarWrapper.html 10KB
class-pywinauto.controls.HwndWrapper.MenuItem.html 10KB
class-pywinauto.controls.common_controls.ToolbarWrapper.html 10KB
class-pywinauto.controls.common_controls.UpDownWrapper.html 10KB
todo.html 10KB
index.html 10KB
module-pywinauto.handleprops-index.html 10KB
class-pywinauto.controls.common_controls.TBButtonWrappper.html 10KB
module-pywinauto.controls.win32_controls.html 9KB
getting_started.html 9KB
class-pywinauto.controls.common_controls.HeaderWrapper.html 9KB
module-pywinauto.findwindows.html 9KB
module-pywinauto.tests.repeatedhotkey.html 9KB
module-pywinauto.controls.HwndWrapper.html 9KB
module-pywinauto.taskbar.html 9KB
module-index.html 8KB
class-pywinauto.controls.common_controls.ToolTipsWrapper.html 8KB
class-pywinauto.controls.common_controls.ReBarWrapper.html 8KB
module-pywinauto.tests.overlapping.html 8KB
module-pywinauto.tests.leadtrailspaces.html 8KB
class-pywinauto.controls.win32_controls.DialogWrapper.html 8KB
class-pywinauto.controls.menuwrapper.Menu.html 8KB
module-pywinauto.findbestmatch-index.html 8KB
module-pywinauto.tests.html 8KB
module-pywinauto.tests.comparetoreffont.html 8KB
module-pywinauto.tests.missingextrastring.html 8KB
class-pywinauto.controls.HwndWrapper.Menu.html 7KB
module-pywinauto.tests.translation.html 7KB
module-pywinauto.tests.asianhotkey.html 7KB
module-pywinauto.controls.menuwrapper.html 7KB
class-pywinauto.controls.win32_controls.PopupMenuWrapper.html 7KB
module-pywinauto.tests.missalignment.html 7KB
module-pywinauto.tests.miscvalues.html 7KB
class-pywinauto.controls.common_controls.DateTimePickerWrapper.html 7KB
module-pywinauto.tests.truncation.html 7KB
class-pywinauto.controls.common_controls.ComboBoxExWrapper.html 6KB
class-pywinauto.controls.common_controls.IPAddressWrapper.html 6KB
class-pywinauto.controls.common_controls.AnimationWrapper.html 6KB
共 213 条
- 1
- 2
- 3
资源评论
- zz0310612013-06-04很好的东西,值得去深入学习
MoveToTheCity
- 粉丝: 1
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功