AirtestProject / AirtestProject/Airtest
windows窗口无法切换到子窗口
- Lingua principale
- Python
- Stelle
- 9.6k
- Fork
- 1.5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**windows窗口无法切换到子窗口**
```
通过 airtest 连接到主窗口,主窗口通过操作打开一个子窗口,但是我没法用 airtest 的 api 去切换到子窗口,需要自己写自定义的方法才行,如下是我自己实现的切换到子窗口后截图判断位置的代码,相当于 exists 方法切换到子窗口去操作。
```
```
from airtest.core.win.win import Windows
dev = device()
child_win = dev._app.window(title="xx", class_name="xx")
handle = child_win.wrapper_object().handle
_dev = Windows(handle=handle)
screen = _dev.snapshot(filename=None, quality=ST.SNAPSHOT_QUALITY)
match_pos = Template(r"tpl1618821110989.png", record_pos=(-0.004, -0.12), resolution=(1667, 887)).match_in(screen)
print(match_pos)
```
**python 版本:** `python3.6.8`
**airtest 版本:** `1.2.8`
**设备:**
- 系统: Windows server 2012 r2
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.