使用 pywinauto 查找 qwidget 对象文本 [英] find qwidget object text by using pywinauto

查看:156
本文介绍了使用 pywinauto 查找 qwidget 对象文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名测试工程师.我必须测试使用 QWidget 完成的应用程序(软电话).我正在使用 python - pywinauto.我可以点击按钮并拨打电话.有一个以 statusLabel 命名的 qwidget 对象.测试开始时,Ready"文字写在上面.当我拨打电话时,此文本会更改为正在呼叫.."、已建立呼叫"等.我想检查那个小部件的文本.你有什么想法吗?

I work as a test engineer. I have to test an application(softphone) which is done by using QWidget. I'm using python - pywinauto. I can click buttons and make calls. There is a qwidget object named with statusLabel. At the beginning of the test, "Ready" text written on it. When I make a call, this text is changed like "Calling..", "Call Established" and so on. I want to check the text of that widget. Do you have any idea?

推荐答案

Pywinauto 使用标准的 Windows API 调用.不幸的是,许多 UI 库(如 Swing/QT/GTK)不会以典型的方式响应所使用的 API 调用 - 因此不幸的是 pywinauto 经常无法获取控制信息.(P.s. 我是 pywinauto 的作者).

Pywinauto uses standard windows API calls. Unfortunately many UI libraries (like Swing/QT/GTK) do not respond in a typical way to the API calls used - so unfortunately pywinauto often cannot get the control information. (P.s. I am the Author of pywinauto).

这篇关于使用 pywinauto 查找 qwidget 对象文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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