# PYWINAUTO TODO’s
* 確保為所有未記錄的方法/函數添加文檔字符串
* 檢查測試的覆蓋范圍并努力增加測試。
* 添加SendInput單擊方法的測試
* 使用FuzzyDict實現findbestmatch。
* 找到一種更好地處理應用程序數據的方法。 目前,如果有人甚至添加了對print_control_identifiers()的調用,它將破壞匹配算法!
* 需要移動檢查,如果一個控件是一個來自__init__方法的Ownerdrawn /位圖控件,并進入它自己的方法,如IsNormallyRendered()(為什么?)
* 舉例說明如何使用Tray Window
* 修復ToolbarWrapper.PressButton()似乎不起作用(發現在IE示例腳本上工作)
* 也許提供一個選項,以便可以使用以下命令運行腳本:
~~~
pywinauto.exe yourscript.py
~~~
這可以通過創建一個導入腳本的Py2exe包裝器(并可選地調用特定的函數?)來實現。
這樣pywinauto可以在沒有安裝python的情況下使用(無論這是一個很大的要求,我不知道,因為自動化語言無論如何都是python!
* 消息陷阱 - 如何處理不需要的消息框彈出?
1. 等待Exception然后在那里處理它
2. 設置陷阱等待特定對話框
3. 在調用窗口規范時,如果我們找不到窗口,那么我們可以快速瀏覽可用的指定陷阱以查看是否有任何陷阱 - 如果他們這樣做我們可以運行相關的操作 - 然后再次嘗試我們的原始對話框
* 處理添加引用控件(因為它們應該是用于查找窗口的控件)
* 找到一個變量的引用名稱,例如在Dialog_write()中我們可以知道調用 _write的變量名(我們不必重復XML文件名!)
* 如果我們在按鈕單擊控制后刪除延遲然后嘗試連續關閉兩個對話框可能會失敗,因為第一個對話框尚未關閉,第二個可能具有相似的標題和相同的關閉按鈕,例如PageSetup.OK.Click() ,PageSetup2.OK.Click()。 一個可能的解決方案可能是在應用程序中保留一個窗口緩存,并且沒有兩個不同的對話框標識符(在這種情況下為PageSetup和PageSetup2)可以具有相同的句柄 - 因此當我們調用PageSetup2時返回PageSetup的句柄會失敗(和 我們會做我們平常的等待,直到成功或超時)。
* 使用以下任何一項進行調查
> * BringWindowToTop: probably necessary before image capture
> * GetTopWindow: maybe to re-set top window after capture?
> * EnumThreadWindows
> * GetGUIThreadInfo
* 使用上下文(右鍵單擊)菜單可以輕松使用
* 進一步支持.NET控件并下載/創建測試.NET應用程序
* 查看支持系統托盤(例如右鍵單擊圖標)
* 提供SystemTray類(可能是單例)
* 查看單擊和文本輸入 - 也許使用SendInput
* 支持Up-Down控件和其他常用控件
* 找出control.item.action()或control.action(item)是否更好
* 創建一個Recorder以可視化創建測試
**低優先級**
* 創建一個類,可以輕松處理單個窗口(例如,沒有應用程序)
* 允許在其他線程中啟動應用程序,這樣我們就不會鎖定
* 這已經完成了-問題是,如果某些消息有指針,那么它們就不能跨進程發送(因此,我們需要發送一條同步消息,該消息在返回前等待另一個進程響應)
* 但我想可以創建一個線程來發送這些消息嗎?
* 從HwndWrapper中解放代碼 - 除了handleprops中提供的內容之外,這些添加內容很少。 這是必需的主要原因是FriendlyClassName。 所以我需要看看是否可以將其轉移到其他地方。
這樣做可能會使層次結構變得相當扁平,并減少對各種包的依賴性
* 需要將菜單項設置為類,而不是Dlg.MenuSelect,我們應該這樣做
~~~
dlg.Menu("blah->blah").select()
~~~
or even
~~~
dlg.Menu.Blah.Blah.select()
~~~
> 要做到這一點,我們需要更改菜單的檢索方式 - 而不是在開始時獲取所有菜單項 - 然后我們只需獲得所需的級別。
>
> 這也可以實現這樣的目標
>
> ~~~
> dlg.Menu.Blah.Blah.IsChecked() IsEnabled(), etc>
> ~~~
## 關閉(以某種方式或其他方式)
* 單擊后允許延遲刪除。 目前需要這樣做的主要原因是因為如果你關閉一個對話框,然后立即嘗試對父進行操作,它可能還沒有激活 - 所以需要延遲才能使它變為活動狀態。 要解決此問題,我們可能需要在對話框上調用操作時添加更多魔法,例如: 在ActionDialog的屬性訪問上執行以下操作:
> * Check if it is an Action
> * If it is not enabled then wait a little bit
> * If it is then wait a little bit and try again
> * repeat that until success or timeout
The main thing that needs to be resolved is that you don’t want two of these waits happening at once (so a wait in a function at 1 level, and another wait in a function called by the other one - because this would mean there would be a VERY long delay while the timeout of the nested function was reached the number of times the calling func tried to succeed!)
* Add referencing by closest static (or surrounding group box?)
* Need to modularize the methods of the common\_controls because at the moment they are much too monolithic.
* Finish example of saving a page from IE
* Document that I have not been able to figure out how to reliably check if a menu item is enabled or not before selecting it. (Probably FIXED NOW!)
For Example in Media Player if you try and click the View->Choose Columns menu item when it is not enabled it crashes Media Player. Theoretically MF\_DISABLED and MF\_GRAYED should be used - but I found that these are not updated (at least for Media Player) until they are dropped down.
* Implement an opional timing/config module so that all timing can be customized
- 什么是Pywinauto
- 入門指南
- 如何
- 等待長時間操作
- 遠程執行指南
- 每種不同控制類型可用的方法
- 貢獻者
- 開發筆記
- 待辦項目
- 更新日志
- 基本用戶輸入模塊
- pywinauto.mouse
- pywinauto.keyboard
- 主要用戶模塊
- pywinauto.application
- pywinauto.findbestmatch
- pywinauto.findwindows
- pywinauto.timings
- 特定功能
- pywinauto.clipboard
- pywinauto.win32_hooks
- 控件參考
- pywinauto.base_wrapper
- pywinauto.controls.hwndwrapper
- pywinauto.controls.menuwrapper
- pywinauto.controls.common_controls
- pywinauto.controls.win32_controls
- pywinauto.controls.uiawrapper
- pywinauto.controls.uia_controls
- Pre-supplied Tests
- pywinauto.tests.allcontrols
- pywinauto.tests.asianhotkey
- pywinauto.tests.comboboxdroppedheight
- pywinauto.tests.comparetoreffont
- pywinauto.tests.leadtrailspaces
- pywinauto.tests.miscvalues
- pywinauto.tests.missalignment
- pywinauto.tests.missingextrastring
- pywinauto.tests.overlapping
- pywinauto.tests.repeatedhotkey
- pywinauto.tests.translation
- pywinauto.tests.truncation
- 后端內部實施模塊
- pywinauto.backend
- pywinauto.element_info
- pywinauto.win32_element_info
- pywinauto.uia_element_info
- pywinauto.uia_defines
- 內部模塊
- pywinauto.controlproperties
- pywinauto.handleprops
- pywinauto.xml_helpers
- pywinauto.fuzzydict
- pywinauto.actionlogger
- pywinauto.sysinfo
- pywinauto.remote_memory_block