1.1 简单介绍

按理所有手动对windows应用程序都可以用python语言来实现, 本节只介绍一些入门级的基础操作,这块功能,就个人理解而言,觉得比之前的logging、telnet、web的操作都复杂一点,因为windows应用程序本身就比较复杂,较难找到统一的一套标准操作流程。

1.1.1 准备工作

[1].    spyxx.exe:

安装:存放在目录resource\tools\microsoft.spy,安装时默认下一步即可。

说明:一个辅助工具在编写windows应用程序的自动化spy++是一个帮助分析windows窗口的利器,可以查看windows窗口的标题、类名、位置、属性、父子关系、句柄等信息,这些信息可以帮助我们写出能控制windows应用程序的python自动化测试脚本

Note:关于spy++工具的操作方法,见附录B.2

 

[2].    安装pip

说明:见3 环境搭建

 

[3].    pywinauton

安装:pip install pywinauto

说明:编写widows应用程序的依赖库。

 

[4].    Wireshark

安装:包路径在resource\tools\wireshark-win32-1.2.4.exe

说明:本节中1.2所示的对wireshark操作的软件。不同版本的wireshark的窗口的一些属性变化挺大的,本节的demo脚本只是对wireshark 32位 1.2.4有用,供参考。

1.2 快速入门

Step1:编辑文件suite\case\show_how\alpha_winapp.py,内容如下:

 1 import os
 2 import time
 3 from pywinauto import Application
 4 import win32api
 5 import win32gui
 6 
 7 os.system("taskkill /F /IM  wireshark.exe")
 8 
 9 win32api.WinExec(r"C:\Program Files (x86)\Wireshark\wireshark.exe", 1)  #starting
10 time.sleep(3)
11 
12 topHandle = win32gui.FindWindow("gdkWindowToplevel", "The Wireshark Network Analyzer")  #get handle of top windows
13 
14 topApp = Application(backend='uia').connect(handle=topHandle)   #relate to Application by handle
15 
16 topApp.Dialog.type_keys("^I")    #send ctrl+I to show the avaliable capture interfaces...
17 time.sleep(2)
18 
19 #will show new dialpg window to select interface option.
20 dilagHandle = win32gui.FindWindow("gdkWindowToplevel","Wireshark: Capture Interfaces")
21 dilagApp = Application(backend='uia').connect(handle=dilagHandle)
22 dilagApp.WiresharkCaptureInterfaces.wiresharkexe10.click_input(button="left")   # click the start button of second line
23 
24 time.sleep(10)   #start capture .... 10 seconds.
25 
26 topApp.Dialog.type_keys("^E")   #send ctrl+E to dialg to stop capture
27 topApp.Dialog.type_keys("^+S")  #send ctrl+shift+S to dialg to save capture as file...
28 
29 dilagHandle = win32gui.FindWindow( None, "Wireshark: Save file as")
30 dilagApp = Application(backend='uia').connect(handle=dilagHandle)
31 dilagApp.top_window().child_window(title="文件名(N):", control_type="Edit").set_edit_text(u'C:\\Users\\20002106\Desktop\\temp\\7.pcap')
32 dilagApp.top_window().child_window(title="保存(S)", control_type="Button").click()
33 
34 topApp.Dialog.type_keys("^Q")   #send ctrl+Q to quit capture

Step2:执行Run的快捷键,Alt+Shift+F10

 

Step3:运行后,会自动打开wireshark,并选择第二接口(因为本人办公PC是双网卡的,第二个接口才是开发项目经常用到的)进行抓报,10秒钟之后,自动点击保存按钮,将文件保存至指定路径下。会在C:\Users\20002106\Desktop\temp下生成文件

pywinauto-windows app操作

pywinauto-windows app操作

1.3 代码解释

1.3.1 导入库文件

在运用pywinauto之前,先导入相关的库文件。

import win32gui
import win32api

from pywinauto.application import Application
from pywinauto.application import WindowSpecification
from pywinauto import actionlogger
from pywinauto import Application

1.3.2 启动应用程序

import win32api

win32api.WinExec(r"C:\Program Files (x86)\Wireshark\wireshark.exe", 1)

1.3.3 获取top窗口

下面这个函数第一个参数是类名,第二个参数是标题名了;返回值是该窗口的控制句柄。

topHandle = win32gui.FindWindow("gdkWindowToplevel", "The Wireshark Network Analyzer")

1.3.4 关联某一个Application

(一)connect

关联一个已经打开的窗口时,可以调用connect函数并传入该窗口的控制句柄。

topApp = Application(backend='uia').connect(handle=topHandle)

 

该函数的详细解释如下:

    Application.connect(**kwargs):

        """Connect to an already running process

 

        The action is performed according to only one of parameters

 

        :param process: a process ID of the target

        :param handle: a window handle of the target

        :param path: a path used to launch the target

        :param timeout: a timeout for process start (relevant if path is specified)

 

        .. seealso::

 

           :func:`pywinauto.findwindows.find_elements` - the keyword arguments that

           are also can be used instead of **process**, **handle** or **path**

        """

(二)start

关联一个还没有打开的窗口时,可以调用start函数并传入执行程序的文件路径。

topApp = Application(backend='uia').start(r"C:\Program Files (x86)\Wireshark\Wireshark-gtk.exe")

 

该函数的详细解释如下:

    Application.start(cmd_line, timeout=None, retry_interval=None,

              create_new_console=False, wait_for_idle=True, work_dir=None):

        """Start the application as specified by cmd_line"""

1.3.5 遍历top窗口

(一)print_control_identifiers

查看该窗口下所有的子窗口的类名、标题、位置、控制类型等信息,可用库WindowSpecification中的函数print_control_identifiers实现。如下是该函数的使用示例:

 

from pywinauto.application import WindowSpecification

import win32gui

def traverse_func(hwnd):
    criteria = {}
    criteria['backend'] = "uia"
   
criteria['handle'] = hwnd
    WindowSpecification(criteria).print_control_identifiers()

#获取top窗口句柄
topHandle = win32gui.FindWindow("gdkWindowToplevel", "The Wireshark Network Analyzer")
#遍历输出该窗口及其所有子窗口下的信息,如类名、标题、位置、控制类型等
traverse_func(topHandle)

 

上面code执行后,会在console端输出如下

  1 C:\Users\20002106\AppData\Local\Programs\Python\Python36\python.exe "D:/auto test/Together_v0.2/suite/case/show_how/debug.py"
  2 Control Identifiers:
  3 
  4 Dialog - 'The Wireshark Network Analyzer'    (L266, T192, R757, B702)
  5 ['Dialog', 'The Wireshark Network Analyzer', 'The Wireshark Network AnalyzerDialog']
  6 child_window(title="The Wireshark Network Analyzer", control_type="Window")
  7    | 
  8    | Pane - 'wireshark.exe'    (L673, T672, R678, B693)
  9    | ['wireshark.exe', 'wireshark.exePane', 'Pane', 'wireshark.exe0', 'wireshark.exe1', 'wireshark.exePane0', 'wireshark.exePane1', 'Pane0', 'Pane1']
 10    | child_window(title="wireshark.exe", control_type="Pane")
 11    | 
 12    | Pane - 'wireshark.exe'    (L540, T672, R545, B693)
 13    | ['wireshark.exe2', 'wireshark.exePane2', 'Pane2']
 14    | child_window(title="wireshark.exe", control_type="Pane")
 15    | 
 16    | Pane - 'wireshark.exe'    (L691, T249, R717, B275)
 17    | ['wireshark.exe3', 'wireshark.exePane3', 'Pane3']
 18    | child_window(title="wireshark.exe", control_type="Pane")
 19    | 
 20    | Pane - 'wireshark.exe'    (L693, T282, R718, B307)
 21    | ['wireshark.exe4', 'wireshark.exePane4', 'Pane4']
 22    | child_window(title="wireshark.exe", control_type="Pane")
 23    | 
 24    | Pane - 'wireshark.exe'    (L318, T282, R693, B307)
 25    | ['wireshark.exe5', 'wireshark.exePane5', 'Pane5']
 26    | child_window(title="wireshark.exe", control_type="Pane")
 27    |    | 
 28    |    | Pane - 'wireshark.exe'    (L320, T284, R691, B305)
 29    |    | ['wireshark.exe6', 'wireshark.exePane6', 'Pane6']
 30    |    | child_window(title="wireshark.exe", control_type="Pane")
 31    | 
 32    | Pane - 'wireshark.exe'    (L665, T249, R691, B275)
 33    | ['wireshark.exe7', 'wireshark.exePane7', 'Pane7']
 34    | child_window(title="wireshark.exe", control_type="Pane")
 35    | 
 36    | Pane - 'wireshark.exe'    (L639, T249, R665, B275)
 37    | ['wireshark.exe8', 'wireshark.exePane8', 'Pane8']
 38    | child_window(title="wireshark.exe", control_type="Pane")
 39    | 
 40    | Pane - 'wireshark.exe'    (L613, T249, R639, B275)
 41    | ['wireshark.exe9', 'wireshark.exePane9', 'Pane9']
 42    | child_window(title="wireshark.exe", control_type="Pane")
 43    | 
 44    | Pane - 'wireshark.exe'    (L731, T312, R748, B653)
 45    | ['wireshark.exe10', 'wireshark.exePane10', 'Pane10']
 46    | child_window(title="wireshark.exe", control_type="Pane")
 47    | 
 48    | Pane - 'wireshark.exe'    (L678, T672, R748, B693)
 49    | ['wireshark.exe11', 'wireshark.exePane11', 'Pane11']
 50    | child_window(title="wireshark.exe", control_type="Pane")
 51    |    | 
 52    |    | Pane - 'wireshark.exe'    (L732, T675, R750, B693)
 53    |    | ['wireshark.exe12', 'wireshark.exePane12', 'Pane12']
 54    |    | child_window(title="wireshark.exe", control_type="Pane")
 55    | 
 56    | Pane - 'wireshark.exe'    (L275, T672, R289, B693)
 57    | ['wireshark.exe13', 'wireshark.exePane13', 'Pane13']
 58    | child_window(title="wireshark.exe", control_type="Pane")
 59    | 
 60    | Pane - 'wireshark.exe'    (L275, T654, R730, B671)
 61    | ['wireshark.exe14', 'wireshark.exePane14', 'Pane14']
 62    | child_window(title="wireshark.exe", control_type="Pane")
 63    | 
 64    | Pane - 'wireshark.exe'    (L275, T312, R730, B653)
 65    | ['wireshark.exe15', 'wireshark.exePane15', 'Pane15']
 66    | child_window(title="wireshark.exe", control_type="Pane")
 67    |    | 
 68    |    | Pane - 'wireshark.exe'    (L277, T314, R728, B651)
 69    |    | ['wireshark.exe16', 'wireshark.exePane16', 'Pane16']
 70    |    | child_window(title="wireshark.exe", control_type="Pane")
 71    |    |    | 
 72    |    |    | Pane - 'wireshark.exe'    (L277, T314, R1654, B859)
 73    |    |    | ['wireshark.exe17', 'wireshark.exePane17', 'Pane17']
 74    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 75    |    |    |    | 
 76    |    |    |    | Pane - 'wireshark.exe'    (L1364, T408, R1644, B849)
 77    |    |    |    | ['wireshark.exe18', 'wireshark.exePane18', 'Pane18']
 78    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 79    |    |    |    |    | 
 80    |    |    |    |    | Pane - 'wireshark.exe'    (L1374, T571, R1634, B618)
 81    |    |    |    |    | ['wireshark.exe19', 'wireshark.exePane19', 'Pane19']
 82    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 83    |    |    |    |    | 
 84    |    |    |    |    | Pane - 'wireshark.exe'    (L1374, T509, R1634, B556)
 85    |    |    |    |    | ['wireshark.exe20', 'wireshark.exePane20', 'Pane20']
 86    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 87    |    |    |    |    | 
 88    |    |    |    |    | Pane - 'wireshark.exe'    (L1374, T447, R1634, B494)
 89    |    |    |    |    | ['wireshark.exe21', 'wireshark.exePane21', 'Pane21']
 90    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 91    |    |    |    |    | 
 92    |    |    |    |    | Pane - 'wireshark.exe'    (L1364, T408, R1644, B432)
 93    |    |    |    |    | ['wireshark.exe22', 'wireshark.exePane22', 'Pane22']
 94    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 95    |    |    |    | 
 96    |    |    |    | Pane - 'wireshark.exe'    (L649, T408, R1354, B849)
 97    |    |    |    | ['wireshark.exe23', 'wireshark.exePane23', 'Pane23']
 98    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
 99    |    |    |    |    | 
100    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T765, R1344, B812)
101    |    |    |    |    | ['wireshark.exe24', 'wireshark.exePane24', 'Pane24']
102    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
103    |    |    |    |    | 
104    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T734, R1344, B755)
105    |    |    |    |    | ['wireshark.exe25', 'wireshark.exePane25', 'Pane25']
106    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
107    |    |    |    |    | 
108    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T712, R1344, B733)
109    |    |    |    |    | ['wireshark.exe26', 'wireshark.exePane26', 'Pane26']
110    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
111    |    |    |    |    | 
112    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T690, R1344, B711)
113    |    |    |    |    | ['wireshark.exe27', 'wireshark.exePane27', 'Pane27']
114    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
115    |    |    |    |    | 
116    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T668, R1344, B689)
117    |    |    |    |    | ['wireshark.exe28', 'wireshark.exePane28', 'Pane28']
118    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
119    |    |    |    |    | 
120    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T646, R1344, B667)
121    |    |    |    |    | ['wireshark.exe29', 'wireshark.exePane29', 'Pane29']
122    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
123    |    |    |    |    | 
124    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T624, R1344, B645)
125    |    |    |    |    | ['wireshark.exe30', 'wireshark.exePane30', 'Pane30']
126    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
127    |    |    |    |    | 
128    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T602, R1344, B623)
129    |    |    |    |    | ['wireshark.exe31', 'wireshark.exePane31', 'Pane31']
130    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
131    |    |    |    |    | 
132    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T580, R1344, B601)
133    |    |    |    |    | ['wireshark.exe32', 'wireshark.exePane32', 'Pane32']
134    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
135    |    |    |    |    | 
136    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T558, R1344, B579)
137    |    |    |    |    | ['wireshark.exe33', 'wireshark.exePane33', 'Pane33']
138    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
139    |    |    |    |    | 
140    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T536, R1344, B557)
141    |    |    |    |    | ['wireshark.exe34', 'wireshark.exePane34', 'Pane34']
142    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
143    |    |    |    |    | 
144    |    |    |    |    | Pane - 'wireshark.exe'    (L659, T447, R1344, B494)
145    |    |    |    |    | ['wireshark.exe35', 'wireshark.exePane35', 'Pane35']
146    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
147    |    |    |    |    | 
148    |    |    |    |    | Pane - 'wireshark.exe'    (L649, T408, R1354, B432)
149    |    |    |    |    | ['wireshark.exe36', 'wireshark.exePane36', 'Pane36']
150    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
151    |    |    |    | 
152    |    |    |    | Pane - 'wireshark.exe'    (L287, T660, R639, B849)
153    |    |    |    | ['wireshark.exe37', 'wireshark.exePane37', 'Pane37']
154    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
155    |    |    |    |    | 
156    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T761, R629, B808)
157    |    |    |    |    | ['wireshark.exe38', 'wireshark.exePane38', 'Pane38']
158    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
159    |    |    |    |    | 
160    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T699, R629, B746)
161    |    |    |    |    | ['wireshark.exe39', 'wireshark.exePane39', 'Pane39']
162    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
163    |    |    |    |    | 
164    |    |    |    |    | Pane - 'wireshark.exe'    (L287, T660, R639, B684)
165    |    |    |    |    | ['wireshark.exe40', 'wireshark.exePane40', 'Pane40']
166    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
167    |    |    |    | 
168    |    |    |    | Pane - 'wireshark.exe'    (L287, T408, R639, B650)
169    |    |    |    | ['wireshark.exe41', 'wireshark.exePane41', 'Pane41']
170    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
171    |    |    |    |    | 
172    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T584, R629, B631)
173    |    |    |    |    | ['wireshark.exe42', 'wireshark.exePane42', 'Pane42']
174    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
175    |    |    |    |    | 
176    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T556, R629, B573)
177    |    |    |    |    | ['wireshark.exe43', 'wireshark.exePane43', 'Pane43']
178    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
179    |    |    |    |    | 
180    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T537, R629, B554)
181    |    |    |    |    | ['wireshark.exe44', 'wireshark.exePane44', 'Pane44']
182    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
183    |    |    |    |    | 
184    |    |    |    |    | Pane - 'wireshark.exe'    (L297, T447, R629, B494)
185    |    |    |    |    | ['wireshark.exe45', 'wireshark.exePane45', 'Pane45']
186    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
187    |    |    |    |    | 
188    |    |    |    |    | Pane - 'wireshark.exe'    (L287, T408, R639, B432)
189    |    |    |    |    | ['wireshark.exe46', 'wireshark.exePane46', 'Pane46']
190    |    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
191    |    |    |    | 
192    |    |    |    | Pane - 'wireshark.exe'    (L277, T314, R1654, B398)
193    |    |    |    | ['wireshark.exe47', 'wireshark.exePane47', 'Pane47']
194    |    |    |    | child_window(title="wireshark.exe", control_type="Pane")
195    | 
196    | Pane - 'wireshark.exe'    (L277, T281, R318, B308)
197    | ['wireshark.exe48', 'wireshark.exePane48', 'Pane48']
198    | child_window(title="wireshark.exe", control_type="Pane")
199    | 
200    | Pane - 'wireshark.exe'    (L721, T249, R746, B275)
201    | ['wireshark.exe49', 'wireshark.exePane49', 'Pane49']
202    | child_window(title="wireshark.exe", control_type="Pane")
203    | 
204    | Pane - 'wireshark.exe'    (L587, T249, R613, B275)
205    | ['wireshark.exe50', 'wireshark.exePane50', 'Pane50']
206    | child_window(title="wireshark.exe", control_type="Pane")
207    | 
208    | Pane - 'wireshark.exe'    (L561, T249, R587, B275)
209    | ['wireshark.exe51', 'wireshark.exePane51', 'Pane51']
210    | child_window(title="wireshark.exe", control_type="Pane")
211    | 
212    | Pane - 'wireshark.exe'    (L523, T249, R549, B275)
213    | ['wireshark.exe52', 'wireshark.exePane52', 'Pane52']
214    | child_window(title="wireshark.exe", control_type="Pane")
215    | 
216    | Pane - 'wireshark.exe'    (L497, T249, R523, B275)
217    | ['wireshark.exe53', 'wireshark.exePane53', 'Pane53']
218    | child_window(title="wireshark.exe", control_type="Pane")
219    | 
220    | Pane - 'wireshark.exe'    (L471, T249, R497, B275)
221    | ['wireshark.exe54', 'wireshark.exePane54', 'Pane54']
222    | child_window(title="wireshark.exe", control_type="Pane")
223    | 
224    | Pane - 'wireshark.exe'    (L445, T249, R471, B275)
225    | ['wireshark.exe55', 'wireshark.exePane55', 'Pane55']
226    | child_window(title="wireshark.exe", control_type="Pane")
227    | 
228    | Pane - 'wireshark.exe'    (L419, T249, R445, B275)
229    | ['wireshark.exe56', 'wireshark.exePane56', 'Pane56']
230    | child_window(title="wireshark.exe", control_type="Pane")
231    | 
232    | Pane - 'wireshark.exe'    (L381, T249, R407, B275)
233    | ['wireshark.exe57', 'wireshark.exePane57', 'Pane57']
234    | child_window(title="wireshark.exe", control_type="Pane")
235    | 
236    | Pane - 'wireshark.exe'    (L355, T249, R381, B275)
237    | ['wireshark.exe58', 'wireshark.exePane58', 'Pane58']
238    | child_window(title="wireshark.exe", control_type="Pane")
239    | 
240    | Pane - 'wireshark.exe'    (L329, T249, R355, B275)
241    | ['wireshark.exe59', 'wireshark.exePane59', 'Pane59']
242    | child_window(title="wireshark.exe", control_type="Pane")
243    | 
244    | Pane - 'wireshark.exe'    (L303, T249, R329, B275)
245    | ['wireshark.exe60', 'wireshark.exePane60', 'Pane60']
246    | child_window(title="wireshark.exe", control_type="Pane")
247    | 
248    | Pane - 'wireshark.exe'    (L277, T249, R303, B275)
249    | ['wireshark.exe61', 'wireshark.exePane61', 'Pane61']
250    | child_window(title="wireshark.exe", control_type="Pane")
251    | 
252    | Pane - 'wireshark.exe'    (L275, T223, R748, B246)
253    | ['wireshark.exe62', 'wireshark.exePane62', 'Pane62']
254    | child_window(title="wireshark.exe", control_type="Pane")
255    |    | 
256    |    | Pane - 'wireshark.exe'    (L719, T223, R760, B246)
257    |    | ['wireshark.exe63', 'wireshark.exePane63', 'Pane63']
258    |    | child_window(title="wireshark.exe", control_type="Pane")
259    |    | 
260    |    | Pane - 'wireshark.exe'    (L673, T223, R719, B246)
261    |    | ['wireshark.exe64', 'wireshark.exePane64', 'Pane64']
262    |    | child_window(title="wireshark.exe", control_type="Pane")
263    |    | 
264    |    | Pane - 'wireshark.exe'    (L599, T223, R673, B246)
265    |    | ['wireshark.exe65', 'wireshark.exePane65', 'Pane65']
266    |    | child_window(title="wireshark.exe", control_type="Pane")
267    |    | 
268    |    | Pane - 'wireshark.exe'    (L535, T223, R599, B246)
269    |    | ['wireshark.exe66', 'wireshark.exePane66', 'Pane66']
270    |    | child_window(title="wireshark.exe", control_type="Pane")
271    |    | 
272    |    | Pane - 'wireshark.exe'    (L477, T223, R535, B246)
273    |    | ['wireshark.exe67', 'wireshark.exePane67', 'Pane67']
274    |    | child_window(title="wireshark.exe", control_type="Pane")
275    |    | 
276    |    | Pane - 'wireshark.exe'    (L417, T223, R477, B246)
277    |    | ['wireshark.exe68', 'wireshark.exePane68', 'Pane68']
278    |    | child_window(title="wireshark.exe", control_type="Pane")
279    |    | 
280    |    | Pane - 'wireshark.exe'    (L386, T223, R417, B246)
281    |    | ['wireshark.exe69', 'wireshark.exePane69', 'Pane69']
282    |    | child_window(title="wireshark.exe", control_type="Pane")
283    |    | 
284    |    | Pane - 'wireshark.exe'    (L345, T223, R386, B246)
285    |    | ['wireshark.exe70', 'wireshark.exePane70', 'Pane70']
286    |    | child_window(title="wireshark.exe", control_type="Pane")
287    |    | 
288    |    | Pane - 'wireshark.exe'    (L309, T223, R345, B246)
289    |    | ['wireshark.exe71', 'wireshark.exePane71', 'Pane71']
290    |    | child_window(title="wireshark.exe", control_type="Pane")
291    |    | 
292    |    | Pane - 'wireshark.exe'    (L276, T223, R309, B246)
293    |    | ['wireshark.exe72', 'wireshark.exePane72', 'Pane72']
294    |    | child_window(title="wireshark.exe", control_type="Pane")
295    | 
296    | Pane - 'wireshark.exe'    (L275, T247, R748, B277)
297    | ['wireshark.exe73', 'wireshark.exePane73', 'Pane73']
298    | child_window(title="wireshark.exe", control_type="Pane")
299    | 
300    | Pane - 'wireshark.exe'    (L275, T279, R748, B310)
301    | ['wireshark.exe74', 'wireshark.exePane74', 'Pane74']
302    | child_window(title="wireshark.exe", control_type="Pane")
303    | 
304    | TitleBar - 'None'    (L290, T195, R749, B222)
305    | ['', 'TitleBar']
306    |    | 
307    |    | Menu - '系统'    (L274, T200, R295, B221)
308    |    | ['Menu', '系统', '系统Menu', '系统0', '系统1']
309    |    | child_window(title="系统", control_type="MenuBar")
310    |    |    | 
311    |    |    | MenuItem - '系统'    (L274, T200, R295, B221)
312    |    |    | ['系统2', '系统MenuItem', 'MenuItem']
313    |    |    | child_window(title="系统", control_type="MenuItem")
314    |    | 
315    |    | Button - '最小化'    (L646, T193, R675, B213)
316    |    | ['最小化Button', 'Button', '最小化', 'Button0', 'Button1']
317    |    | child_window(title="最小化", control_type="Button")
318    |    | 
319    |    | Button - '最大化'    (L675, T193, R702, B213)
320    |    | ['最大化Button', 'Button2', '最大化']
321    |    | child_window(title="最大化", control_type="Button")
322    |    | 
323    |    | Button - '关闭'    (L702, T193, R751, B213)
324    |    | ['关闭', 'Button3', '关闭Button']
325    |    | child_window(title="关闭", control_type="Button")
326 
327 Process finished with exit code 0
top窗口遍历

相关文章: