Pywinauto 控制/像弹出窗口一样连接到窗口 [英] Pywinauto control / connect to window like popup

查看:64
本文介绍了Pywinauto 控制/像弹出窗口一样连接到窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在软件上使用 pywinauto 进行一些 gui 自动化我成功打开软件然后执行一些操作,例如连接到顶部窗口并单击编辑字段(输入)上的元素和 type_keys 并登录

Im try to do some gui automation with pywinauto on software i succeeded to open the software then do some thing like connect to top window and click on elements and type_keys on edit fields (input) and login

但是当我点击某个元素时出现问题,新窗口正在打开,但我无法在该窗口上执行操作 - 没有连接标题,我无法找到我尝试使用顶部窗口的窗口但它现在工作

but there is a problem when i click on some element new window was opening but i cant do actions on the window - no title to connect i cant find the window i was try with top window but its now working

它就像进行一些安装的弹出窗口,我无法控制窗口或窗口上的任何元素

its like popup window that make some installation and i cant control the window or any elements on the window

参见图片示例

在此处输入图片说明

在此处输入图片说明

编辑 1:我尝试与 top_window() 连接 - 不工作我尝试创建到顶部窗口的新连接,但我没有任何标题

EDIT 1: i try to connect with top_window() - not working and i try to create new connection to the top window but i dont have any title

谢谢:)

推荐答案

首先你需要知道新窗口是顶级窗口还是主窗口的子窗口.您可以使用 Windows SDK 中的 Inspect.exe 来查看元素层次结构或 print([w.window_text() for w in Desktop(backend=uia").windows()]) 打印所有顶级窗口标题.

First you need to know if the new window is top level or child of main window. You can use Inspect.exe from Windows SDK to view the elements hierarchy or print([w.window_text() for w in Desktop(backend="uia").windows()]) to print all top level window titles.

这篇关于Pywinauto 控制/像弹出窗口一样连接到窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆